DB2 API

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
vikas gupta
Participant
Posts: 30
Joined: Wed Mar 24, 2004 1:28 am

DB2 API

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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!!
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Post 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
In theory there's no difference between theory and practice. In practice there is.
Post Reply