When executing
SELECT * FROM SYSOPTIONS WHERE "option" LIKE '%key%'
the results are different in Freedts ODBC rather than Sysbase ODBC or Central, reasons are simple and how to avoid are showed in this article!
Here were show how to avoid those little mistakes, it's not faults of ODBC freetds (versions 0.81, 0.86, 0.91 or 0.95 that returns 0 rows if you typed bad the sql sentence), here are the reasons and how to correctly make it!
"
) quotes as SQL standar said! lest get see the problem:
As discutes here: https://github.com/FreeTDS/freetds/issues/99#issuecomment-464721522
if you used "*" event "option" you got the values, and so then the problems here are the reserved keyword
option
, so i got a workaround by using ` in the query event using "
and got results... so but "why" its confused and use the `"` in the querys'? well as in the picture, i see that the very stupid sybase tools use that for reserved keyword i try stupidy to use at the freetds, but that are non-standar way due reserved keywords must be using with single quotes ` and not double quotes "
see the examples output below:SQL> SELECT "option" FROM master..SYSOPTIONS
+---------+
| 'option'|
+---------+
| option |
/*.... more results cutted due i pasted in less space....*/
| option |
+---------+
SQLRowCount returns 151
151 rows fetched
SQL>
SQL> SELECT `option` FROM SYSOPTIONS WHERE `option` LIKE '%key%'
+---------------------------------------------------------------------------------------------------------------------------------+
| option |
+---------------------------------------------------------------------------------------------------------------------------------+
| non_keywords |
| reserved_keywords |
| prevent_article_pkey_update |
| secure_feature_key |
+---------------------------------------------------------------------------------------------------------------------------------+
SQLRowCount returns 4
4 rows fetched
SQL>
No hay comentarios.:
Publicar un comentario
no stupid winbuntu users allowed!