[unixODBC-dev] Problem getting error on SQL_NO_DATA
ZIGLIO, Frediano, VF-IT
Frediano.Ziglio at vodafone.com
Fri Apr 8 13:14:29 BST 2005
> After some tests if seems that if a function (SQLFetch or
> SQLMoreResults) return SQL_NO_DATA it can also return warning/errors
> however the way unixODBC work (cache error on
> SQL_SUCCESS_WITH_INFO/SQL_ERROR) do not work cause it do not expect
> diagnostics on SQL_NO_DATA.
> For example using a store procedure with this body on mssql
> SELECT 1
> RAISERROR ('test', 16, 1)
> using this sequence
> SQLFetch (success)
> SQLFetch (no data)
> this last fetch return 'test' diagnostic (RAISERROR cause a diagnostic
> information to be returned from server)
An addition to above.
It would be nice if instead of reading diagnostic just after every
function called unixODBC could cache diagnostic on first diagnostic
call. Just add a flag diagnostic readed to every handle, set when read
and reset before calling any function.
More information about the unixODBC-dev