Syntax Error while SELECTing Data From Sybase


We are trying to query data from some tables in Sybase (System 11) running on Solaris.

Our client application consists of SqlDBX, running on Windows Vista, that connects to the Sybase server through ODBC.

The following query returns data:

but the following query

fails with this error:
    DIAG [42000] [INTERSOLV][ODBC SQL Server driver][SQL Server]Incorrect syntax    
    near 'FROMsysobjectss'. (102)

Note that in the error message, there is no space between "FROM" and "sysobjects", and there is an extra "s" at the end of "sysobjects".

The above is just an example of the odd behavior we have observed.  For other tables, behavior of the query depends on the content of the WHERE clause.

Thanks for your help.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

do you have a problem with

select * from sysobjects;


does the problem persist if you STOP ABD START THE CONNECTION?

what has changed recently?
Joe WoodhousePrincipal ConsultantCommented:
What is the exact version of your ODBC driver? I know Sybase System 11 (now that's going back a bit Released in 1996!) was called "SQL Server" back then, but I want to make sure you're using the right one... and not, say, an ODBC driver for MS SQL Server instead.
merimohAuthor Commented:
The ODBC driver version is 3.01.0000 (Date 08/12/1997).  On our client machine, we tried to use a new DataDirect driver but we could not get it to work (in the sense that sqlDBX just freezes when we open a session with a DSN created with the DataDirect driver).  It does not help that we do not have access to the server (machine) that hosts Sybase.

We started working on this only last week but the server has been running (with other apps) from several years now.  Therefore, what is happening is not due to a recent (inadvertant) config change.

One more data point we found today:
 --> The query "SELECT * FROM SYSOBJECTS" works fine from isql.  But this same query does not work from sqlDBX whether we end it with semi-colon or not.

I read somewhere that ODBC for System 11 and earlier is built on top of Open Client.  So the above proves that isql, which is at the Open Client level, works fine, but the ODBC layer is probably the one generating this error.


Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Joe WoodhousePrincipal ConsultantCommented:
I agree it looks like ODBC is what's giving you the problem, since isql doesn't use it. And yes, the early versions of ODBC had to sit on top of Open Client.

All I can suggest is trying to find other (very old) ODBC drivers, and also trying any other ODBC client tool with your current driver - maybe sqlDBX is the problem here?
merimohAuthor Commented:
We tried to find a different ODBC driver that would work with this (old) version of the DB but could locate any.

However, one thing we found out is that Sybase acts only as an "interface" to another vendor-specific datastore.  I mean, what might be used here is this:
A Specialty Data Store allows Adaptive Server clients to access external data as if it were stored locally in the Adaptive Server. A Specialty Data Store is an Open Server application designed to interface with the Adaptive Server

No way to verify though.

Question PAQ'd, 500 points refunded, and stored in the solution database.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Sybase Database

From novice to tech pro — start learning today.