Table IO partial key update

bozo

Member
I want to

UPDATE F0411
SET RPURAB = 0
WHERE RPKCO = '00172'

using Event Rules in a UBE running on Oracle. If I try a table IO Update statement, the KCO bit shows = in the table IO window and the URAB bit shows -> like I'd expect, but the log reports that it's actually doing

UPDATE F0411
SET RPKCO = '00172',RPURAB = 0

which is highly undesirable. Is this supposed to happen?

Keith Hollins
Atkins
 
What key were you using for the update?
You may need to create a key on the file, that just has KCO. Then use this single key to update the URAB. That will work.

Cheers,



Peter Hamilton
Xe/B9, Windows NT, AS400
 
Keith,

All the experience I have had regarding partial key updates in ER has lead me to believe the only way to accomplish the task is if the WHERE clause fields are _all_ at the top of the key for the particular index you are using.

For example, for your update to work, you'd need an index that has KCO as the first key field of that index. You will get unexpected results if any keyfield 'gaps' exist in your update statement. In other words, you could not do an update using keyfields 1 and 3 (must also use keyfield 2).

Hope that made sense.
 
Back
Top