Where Current of of vs UPDATE

Where Current of of vs UPDATE

 

  

I have an application on z/OS which reads a file and for each record it
issues a SELECT on a Table (unique key taken from Input Record so a maximum
of one row could be returned) if the row exists then the program issues an
UPDATE for the same row to update a TIMESTAMP column,

My Question is should the Select be a Cursor with FOR UPDATE OF Timestamp
Column then the Update be converted to UPDATE WHERE CURRENT OF CURSOR.

Which option is the most efficient, which will lock the least and more
importantly which option is more likely to cause me some grief when the
batch file gets bigger and the job may continue to run into the online day.


PS - The Program commits after 20 reads regardless of whether any updates
were done.

Thanks

Gwyn Pritchard
Senior DBA
Barclays Bank
UK




This e-mail and any attachments are confidential and intended solely for the addressee and may also be privileged or exempt from disclosure under applicable law. If you are not the addressee, or have received this e-mail in error, please notify the sender immediately, delete it from your system and do not copy, disclose or otherwise act upon any part of this e-mail or its attachments.

Internet communications are not guaranteed to be secure or virus-free.
The Barclays Group does not accept responsibility for any loss arising from unauthorised access to, or interference with, any Internet communications by any third party, or from the transmission of any viruses. Replies to this e-mail may be monitored by the Barclays Group for operational or business reasons.

Any opinion or other information in this e-mail or its attachments that does not relate to the business of the Barclays Group is personal to the sender and is not given or endorsed by the Barclays Group.

Barclays Bank PLC.Registered in England and Wales (registered no. 1026167).
Registered Office: 1 Churchill Place, London, E14 5HP, United Kingdom.

Barclays Bank PLC is authorised and regulated by the Financial Services Authority.

DB2 & UDB email list listserv db2-l LazyDBA home page