11

I am having a Update Statement on a large volume table. It updates only one row at a time.

Update MyTable
Set Col1 = Value
where primary key filters

With this update statement gets executed I also want a value in return to avoid a Select Query on a same table to save resources. What will be my syntax to achieve this?

Romesh
  • 2,291
  • 3
  • 24
  • 47

1 Answers1

11

You can use the RETURNING keyword.

Update MyTable
Set Col1 = Value
where primary key filters
returning column1,column2...
into variable1,variable2...
Noel
  • 10,152
  • 30
  • 45
  • 67