Page 1 of 1

DB2 API

Posted: Tue Feb 22, 2005 1:32 am
by vikas gupta
How I will avoid warring massage in below bold letter, when I am updating records using DB2/UDB API Stage. I know that target database have no match id records.

[IBM][CLI Driver][DB2/AIX64] SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000

But in Oracle_OCI do not create warning massage for it.

Posted: Tue Feb 22, 2005 7:15 am
by chulett
Basically, the answer is to not perform the update when there is no matching record. Oracle doesn't consider that an event worth noting, which is why you can 'get away' with it, however DB2 does.

You need to use the oh-so-common technique of hashing up the current business keys on file and then only issuing the update (via a constraint) when the record exists - i.e. is in the hash file.

Posted: Tue Feb 22, 2005 7:24 am
by Sainath.Srinivasan
Even though you can use hash files to check for keys, I have noticed similar DB2 message appear when the table is empty and you try 'Clear table, then insert rows'.

The solution can be to fix with selecting the rows and determining whether to clear if rowcount > 0. I wonder whether there is an alternative way!!

Posted: Tue Feb 22, 2005 10:50 am
by ogmios
Your DB2 administrators can also make the warning go away by changing a setting on the db2 side, never bothered so far to find out just what setting it is.

Ogmios