Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB-Library error 102 #88

Open
ohadle opened this issue Aug 25, 2016 · 4 comments
Open

DB-Library error 102 #88

ohadle opened this issue Aug 25, 2016 · 4 comments

Comments

@ohadle
Copy link

ohadle commented Aug 25, 2016

Having defined a new Sybase IQ SERVER and FOREIGN TABLE, I run a query and get this error:

postgres=> SELECT * FROM sap.bla_table
LIMIT 100
;
ERROR:  DB-Library error: DB #: 102, DB Msg: General SQL Server error: Check messages from the SQL Server, OS #: -1, OS Msg: , Level: 15

Also tried setting the server's tds_version to 5.0 but that didn't help.

@Smtgr14
Copy link

Smtgr14 commented Oct 26, 2016

Error 102 is a syntax error on the MSSQL side.
Can you run

ALTER SERVER [SERVER NAME] 
   OPTIONS (ADD msg_handler 'notice');

Try your query again and post the output.

@ohadle
Copy link
Author

ohadle commented Nov 2, 2016

Slightly different now:

NOTICE:  DB-Library notice: Msg #: 21, Msg state: 0, Msg: TDS: unexpected token 56, Server: [some-url.com:3000], Process: , Line: 0, Level: 10
NOTICE:  DB-Library notice: Msg #: 102, Msg state: 0, Msg: SQL Anywhere Error -131: Syntax error near 'use' on line 1, Server: [some-url.com:3000], Process: , Line: 0, Level: 15
ERROR:  DB-Library error: DB #: 102, DB Msg: General SQL Server error: Check messages from the SQL Server, OS #: -1, OS Msg: , Level: 15

@GeoffMontee
Copy link
Collaborator

It looks like the syntax error is with "USE":

NOTICE:  DB-Library notice: Msg #: 102, Msg state: 0, Msg: SQL Anywhere Error -131: Syntax error near 'use' on line 1, Server: [some-url.com:3000], Process: , Line: 0, Level: 15

In the most recent version of tds_fdw, it only sends the use keyword if the dbuse foreign server option is set to 1, and the default value is 0. Otherwise, it selects the database at connection time.

What version of tds_fdw are you using? I would suggest using either 1.0.8 if you want a stable release or the master branch if you want to test out WHERE and column pushdowns.

@ohadle
Copy link
Author

ohadle commented Nov 3, 2016

I'm not really sure, but I do see a repo clone I did here :) From Aug. 14 (commit ef2afe1).
The dbuse option isn't set.

BTW it's a Sybase IQ server if that's relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants