WinSQL » Knowledge base

Document information

Document ID: 744
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.

Problem description

This problem occurs when you use the ODBC driver from IBM with WinSQL and the version of the ODBC driver is above FP8.

Solution

You have one of the two choices described below.
  1. Use a different driver. We recommend using WinSQL DB2 Wire Protocol Driver
  2. Use WinSQL 5.0.55 or above. Click on Edit/Options and uncheck "Show warning messages"

Technical description

This warning message is displayed because IBM's ODBC driver returns this string when any ODBC application calls SQLGetDiagFieldW() after a SQL_NO_DATA_FOUND is returned for SQLFetch().

Consider the following scenario:

  • Application calls SQLFetch() method
  • ODBC driver returns SQL_NO_DATA_FOUND when no more records are available
  • Application calls SQLGetDiagField() method
  • IBM driver returns this warning message

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.






Add a comment to this document

Do you have a helpful tip related to this document that you'd like to share with other users?

Important: This area is reserved for useful tips. Therefore, do not post any questions here. Instead, use our public forums to post questions.

Navigation

Social Media

Powered by 10MinutesWeb.com