Sybase and OLE DB or ODBC

  • I am using Sybase 12.5 and using VS2005. I have created the connection string for OLE DB and ODBC (also testing with ASE ADO). My assignment is to create a small benchmark to see which is faster (between ODBC, OLE DB and ASE ADO). I have not problem connection to sybase using any of the three above mentioned but when my Dynamic SQL becomes to complex then OLE DB and ODBC cannot return any result set (zero rows) even though I am getting the column name. The entire Dynamic SQL is using 8 tables on WHERE clause and also using two more subselects. Making a "try and error" I am found that I can join until three (3) tables (meaning, I am getting a result set) but when I am adding the four (4) table is when OLE DB and ODBC are not returning result set. I will appreciate any comment or any idea about OLE DB and ODBC settings that I have to add. Thank you.

  • I found the problem. In a where condition, I am passing the string "NULL" as follow:

    AND IN ( 'N', 'n', NULL)

    if I remove the NULL then everything works fine. Seems like I have to pass some other value different that NULL like System.DBNull or something else.

    Any ideas?

  • Here the solution,

    Dynamic SQL, meaning, it can be huge. the joins or inside the WHERE clause you have to use NULL saying "AND ( attribute IN ( 'your values' ) OR attribute IS NULL )". Big different is you used as "AND attribute IN ( 'your values', NULL )"

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply