I have a use case that requires me to make a join on a table t1 from Sybase ASE and table t2 from Sybase IQ . I am trying to achieve this by creating a proxy_table on Sybase IQ as follows:

create server SYB1 class 'ASAODBC' using    
Driver=libsyb64.so;Server=hostname;Port=portnum;PacketSize=16384;
EnableServerPacketSize=0'

(I even tried above with 'ASEODBC' and 'ODBC' classes)

create external login XYZ to SYB1 remote login 'SYBASEASEusername' 
identified by SYBASEASEpwd'
create existing table 'proxy_table_name' at 'SYB1.dbname.owner.tablename'

On firing above sqls I get: [Sybase][ODBC Driver][Sybase IQ] Unable to connect to 'SYB1': [Sybase][ODBC Driver] [SQL Anywhere] Unable to connect ; server definition is circular

I have entry for the above mentioned Sybase ASE host in interfaces file and I tried to create the server by specifying the server name itself but it failed nevertheless.

Any help appreciated.

asked 01 Mar '14, 01:37

birjoossh's gravatar image

birjoossh
16112
accept rate: 0%

Question 1: What version of SQL Anywhere are you using?

Question 2: What is the exact code you are using?

create server SYB1 class 'ASAODBC' using    
Driver=libsyb64.so;Server=hostname;Port=portnum;PacketSize=16384;
EnableServerPacketSize=0'

Could not execute statement.
Syntax error near 'Driver' on line 2
SQLCODE=-131, ODBC 3 State="42000"

create external login XYZ to SYB1 remote login 'SYBASEASEusername' 
identified by SYBASEASEpwd'
create existing table 'proxy_table_name' at 'SYB1.dbname.owner.tablename'

Syntax error on line 4, column 0: Illegal character "\n" (10)
(02 Mar '14, 04:45) Breck Carter

In addition to Breck's questions:

  • If you are connecting TO ASE then you should use class ASEODBC (using class ASAODBC just won't work)

  • You are missing a quote before Driver and also missing another quote in front of SYBASEASEpwd ... hence Breck's question: Show us the EXACT CODE that you are using.

(02 Mar '14, 08:25) Mark Culp

The problem is that the SAP ODBC Driver Manager is not able to load the libsys64 driver for whatever reason and is therefore falling back on libodbc.so which is probably sym linked to the IQ ODBC Driver. Try removing the libodbc.so sym link and see if that gives you more information as to why the original driver could not be loaded. Also, it would be best if you specified the full path to the ASE ODBC driver instead of a relative path.

permanent link

answered 04 Mar '14, 10:06

Karim%20Khamis's gravatar image

Karim Khamis
5.7k53870
accept rate: 40%

See Unable to connect, server definition is circular: You attempted to connect to a remote server that maps to the local database.

[begin TL;DR]

That means you are running CREATE SERVER on the same database as the USING clause is pointing to. In most cases that is a user error, which is probably why they don't let you do it.

Please note that this is a SQL Anywhere forum, not an IQ forum. Perhaps you've never heard of SQL Anywhere... that's OK, it's very much a stealth product.

If you are trying to to run a CREATE SERVER on a SQL Anywhere database that is pointing to an IQ database, use CLASS 'IQODBC'. CLASS 'ASEODBC' is for ASE and 'SAODBC' is for SQL Anywhere (CLASS 'ASAODBC' is not documented, at least for SQL Anywhere 16 it's not).

...which leads me to believe you are writing code to run on IQ rather than a really old version of SQL Anywhere (CLASS 'ASAODBC' exists on IQ as well as SQL Anywhere Version 9 and earlier.)

Google is your friend; a search on "Unable to connect, server definition is circular" leads directly to this IQ documentation page which says exactly the same thing, which is understandable because a large part of IQ (parser etcetera) comes from SQL Anywhere.

So, I'll bet you have either (a) named the wrong target database in the USING clause or (b) run the CREATE SERVER statement on the wrong database.

Do I win? Or will I have to eat Surströmming? :)

[end TL;DR]

permanent link

answered 02 Mar '14, 05:11

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050
accept rate: 20%

edited 02 Mar '14, 05:27

Is the Wikipedia article on TL;DR a perfect example of TL;DR?

Enquiring minds are struggling with that question :)

(02 Mar '14, 05:28) Breck Carter

HI, First all apology for asking on incorrect forum. This indeed is related to Sybase IQ. However I am pretty sure that I am specifying an ASE hostname and firing the query from Sybase IQ client. Also the DB that I specified exists on the ASE server specified and accessible with the creds specified in 'create external login' statement. Request you to please suggest if I am missing anything here.

(02 Mar '14, 07:54) birjoossh
Replies hidden

Show the actual code. The code you posted won't even compile.

(02 Mar '14, 11:08) Breck Carter
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×145
×69
×41

question asked: 01 Mar '14, 01:37

question was seen: 9,259 times

last updated: 04 Mar '14, 10:06