Thanks for the continued help, Dimandja. You originally suggested the sql statement
UPDATE a-table SET b-field = some-value WHERE c-field IN (SELECT c-field FROM a-table WHERE d-field IS other-value FETCH FIRST 5 ROWS ONLY)
What I fear will happen with this query (and I might be wrong) is...
Thanks, but what I really want is doing FETCH FIRST 5 ROWS ONLY FOR UPDATE and that doesn't work for DB2. If I skip the FOR UPDATE clause, I run into concurrency problems.
No, I think that the syntax "top 5" is illegal for DB2. I also belive that this is the Oracle equivalant of DB2's "fetch first 5 rows only". But thanks anyway.
Hi. I want to write a query that returns a set of rows from a table. All those rows should fulfill several requirements, as specified by the query's where clause, AND I want to get exactly 5 (or X) number of rows AND I want to set an UPDATE lock on those rows.
I don't care if those 5 rows are...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.