Oracle Upgrade and Refunds

I have an Update Statement table in a large table. It updates only one row at a time.

 Update MyTable Set Col1 = Value where primary key filters 

When executing this update statement, I also want to get the value in reverse order to avoid Select Query in the same table to save resources. What will be my syntax to achieve this?

+4
source share
2 answers

You can use the RETURNING keyword.

 Update MyTable Set Col1 = Value where primary key filters returning column1,column2... into variable1,variable2... 
+7
source

If you are sure that it updates only one row, write the same filter to request a choice, for example:

 SELECT * FROM MyTable where primary key filters 
0
source

Source: https://habr.com/ru/post/1482928/


All Articles