ODBC application error

Laura M. Castro laura@REDACTED
Wed Sep 28 18:37:31 CEST 2005


  Hello again,

> One potential problem I can see is if it returns SQL_SUCCESS_WITH_INFO
> as this has been used to indicate an error in the user input by
> drivers in this particular situation. I no longer recall exactly what
> the odbc standard says about this, but we have a comment in the code
> stating this to be the case, and only SQL_SUCCESS is considered to
> be correct. Maybe this could be a problem of different interpretations
> of the standard. If you find anything out please let me know.

    Yes, after having a quick look at odbcserver.c, I suspected the
same. The source code fragment you are referring to is:

/* SQL_SUCCESS_WITH_INFO at this point indicates error in user input. */
if (result != SQL_SUCCESS) {
    diagnos =  get_diagnos(SQL_HANDLE_STMT, statement_handle(state));
    msg = encode_error_message(diagnos.error_msg);
    clean_state(state);
    return msg;
}

    But that is not the case: in fact, the value assigned to the
variable 'result' is 100, that corresponds with the constant SQL_NO_DATA.

    I do not know the details of the ODBC standard either, so I am not
sure at all about which of the different result code constants present
in odbc.hrl should be taken into account in that 'if' condition...

    Anyway, it seems that the mystery is all over :-D.

    Cheers,

	Laura Castro



More information about the erlang-questions mailing list