|Subject:||No row was found for FETCH, UPDATE or DELETE|
|Creation date:||7/29/09 9:44 AM|
|Last modified on:||7/29/09 11:14 AM|
DB2 returns the following error after running any query in WinSQL.
No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table.
Consider the following scenario:
A typical ODBC application does not call SQLGetDiagField() after SQL_NO_DATA_FOUND is received. However, it is called in WinSQL, which is done for compatibility reason with other databases like Sybase and MS SQL Server.
PRINT and RAISE ERROR statements in Sybase and MS SQL Server are returned by SQLGetDiagField() method even after a SQL_NO_DATA_FOUND was returned for previous call. Therefore, if WinSQL would not call this function after SQLFetch, it would not be able to get the warning message.
Normally an ODBC driver returns a blank string if no error or warning messages are available in their error buffers. However, IBM's driver returns this string instead. WinSQL built 5.0.55 provides the ability to suppress these warning messages and therefore, you don't see this problem.