Background information

Oracle supports Select for update and For update of column syntaxes, which are not different for a single table. They are both locking related rows that meet the conditions For a single table. For multiple tables, update locks the rows that match the conditions in multiple tables. For update of locks the rows in the corresponding tables based on the conditions. Examples:
  • Single Table

    select * from test where id =10 for update

    select * from test where id=10 for update id

    Note Lock the row with id=10.
  • Multiple tables

    select * from test inner join t1 on test.id=t1.id where test.id=10 for update

    select * from test inner join t1 on test.id=t1.id where test.id=10 for update of test

    Note Lock the rows test and t1 with id=10.

New solution

Currently, PolarDB only supports the syntax For update and does not support the syntax For For update of. You can adjust the syntax to For update as appropriate based on business situations.