[unixODBC-dev] Problem getting error on SQL_NO_DATA

Nick Gorham nick at lurcher.org
Fri Apr 8 14:03:05 BST 2005


ZIGLIO, Frediano, VF-IT wrote:
>>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
>>
>>   SQLBindCol
>>   SQLExecDirect
>>   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.
> 

Not quite sure what you mean. That sounds a bit like ODBC 2 used to work 
(Before MS rewrote history) it saved the errors for each handle until 
cleared with SQLError. unixODBC used to do that, it still can if you 
define USE_OLD_ODBC2_ERROR_CLEARING

-- 
Nick



More information about the unixODBC-dev mailing list