[unixODBC-dev] SAP tests, myodbc native error codes?

Peter Harvey pharvey at peterharvey.org
Wed Apr 20 16:36:30 BST 2005


Eric,

Lucky I caught this email. I have been ignoring much email lately in 
favour of some coding ;)

MyODBC does not use the same return codes as SAP ODBC driver. They are 
two different drivers. So the stuff you are looking at is for SAP. I 
know this, generic vs db specific, issue has come up before but I do not 
recall a solution.

One approach is that the SAP specific stuff could be left intact 
(probably would mean naming the tests dir to indicate this). And then 
create a seperate tests dir for generic ODBC tests and this would/could 
contain references to the tests in the SAP dir (or vice-versa) where 
they are generic.

Another approach would be to elminiate db/vendor sepecifc tests all 
together. Perhaps easiest but I think less desirable.

Peter


Eric Sharkey wrote:

>Hi Peter,
>
>I'm starting to work on the SAP tests again.
>
>The first test that my driver fails is the "cola" test.  It seems
>to be using this macro to test the success or failure of ODBC
>calls.
>
>#define ERROR_CHECK(hstmtx)      if (retcode != SQL_SUCCESS) {\
>                           SQLError(henv,\
>                                    hdbc,\
>                                    hstmtx,\
>                                    sqlstate,\
>                                    &esq_sql_code,\
>                                    error_txt,\
>                                    len_error_txt,\
>                                    &used_error_txt);\
>                           printf(" sqlstate: %s"CRLF, sqlstate);\
>                  printf(" esq_sql_code: %d"CRLF, esq_sql_code);\
>                  switch (retcode) {\
>                  case(100) :\
>                          break;\
>                  default:\
>                     if (esq_sql_code != -6000 && \
>                         esq_sql_code != -4004 && \
>                         esq_sql_code != 1051  && \
>                         esq_sql_code != 1064)\
>                          return(16);\
>                          break; } }
>
>You can see that it's using the native error codes to determine
>when a failure is fatal, and this is clearly not portable across
>data sources.
>
>Is there a complete table of MyODBC error codes somewhere?  I found
>this link:
>
>http://dev.mysql.com/doc/mysql/en/myodbc-error-codes.html
>
>But none of the numbers in the macro above are listed.
>
>Eric
>_______________________________________________
>unixODBC-dev mailing list
>unixODBC-dev at easysoft.com
>http://mail.easysoft.com/mailman/listinfo/unixodbc-dev
>
>
>  
>




More information about the unixODBC-dev mailing list