Posts

Showing posts from November, 2026

Oracle AI Database 26ai(23.26.4):SELECT FOR UPDATE with Row Limit

  Oracle AI Database 26ai Release 23.26.4 introduces support for combining Top-N queries using the FETCH FIRST clause with FOR UPDATE [SKIP LOCKED]. This enhancement allows applications to retrieve and lock a limited number of rows using the FETCH FIRST clause, simplifying the implementation of batch-processing operations that require controlled row-level locking. Testing the Feature The PERSON table contains the following rows: SQL > select * from person; ID FNAME LNAME SAL ---------- ---------- --------------- ---------- 1 Vahid Yousefzadeh 4 2 Nader DastNeshan 5 3 Kourosh Barmak 6 The FETCH FIRST clause works correctly when used without FOR UPDATE SKIP LOCKED : SQL > select * from person order by 1 FETCH FIRST 1 ROWS ONLY ; ID FNAME LNAME SAL ---------- ---------- --------------- ---------- 1 Vahid ...