[unixODBC-dev] Problem getting error on SQL_NO_DATA

Eric Sharkey sharkey at netrics.com
Fri Apr 8 15:39:13 BST 2005


> >I'm confused.  Why are you checking the return code at all?  I thought
> >the only return code which would assure no diagnostic records was
> >SQL_INVALID_HANDLE.  Although uncommon, a driver can return diagnostics
> >even with SQL_SUCCESS, right?
> >  
> >
> Not as far as I know, thats what the SQL_SUCCESS_WITH_INFO is used to 
> signify. What point would there be to have that if it could return a 
> warning with a SQL_SUCCESS. or for that matter a error diagnostic with a 
> SQL_SUCCESS return.

Hmm.  Maybe I've read this wrong:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcreturn_codes.asp

My understanding was:

SQL_SUCCESS is returned when there are no or only "informational" diagnostics.

SQL_SUCCESS_WITH_INFO is returned when there are "warning" diagnostics.

SQL_ERROR is returned when there are fatal error conditions.


But now that I re-read this, I see that SQL_SUCCESS explicitly says
diagnostics are available from "the header record", so I guess you're
right.

But it's still the case that the other return codes, like NEED_DATA or
STILL_EXECUTING may post diagnostics.

Eric



More information about the unixODBC-dev mailing list