Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
Good morning. Question, if I do a FETCH on a SELECT statement that has "FOR UPDATE OF" specified, can I do multiple updates to that record before FETCHING the next record? What I want to do is do an UPDATE to a "start date/time" field with the "WHERE CURRENT OF <cursor name>", then when the processing for that record is finished, do another UPDATE to the "end date/time" field using the "WHERE CURRENT OF <cursor name>" again. Once I've updated both start and end date and times, I would then FETCH the next record.
Let me know if that's ok. Thanks!
Uh I'll take a guess. YES. When you do an SQL Cursor UPDATE, the row is still locked (amazingly, it's true). That tells me you could UPDATE again if you wanted to. Try it and let us know. Thanks!
Chris Ringer
I'll do that! Thanks, Chris. I just wasn't sure if the update would release it and cause an error like it would if you did a CHAIN and UPDATE to a record. Thanks again!
Thanks, Chris. It did work!! Awesome!! Thanks!