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?
The update() method returns an integer that indicates the update count for the SQL statement. The updateMany() method returns an array of integers, each integer indicating the update count for a single run of the SQL statement.
A stored procedure does not have a return value but can optionally take input, output, or input-output parameters. A stored procedure can return output through any output or input-output parameter.
CURRENT_DATE returns the current date in the session time zone, in a value in the Gregorian calendar of datatype DATE .
CHR(10) is used to insert line breaks, CHR(9) is for tabs, and CHR(13) is for carriage returns.
You can use the RETURNING keyword.
Update MyTable
Set Col1 = Value
where primary key filters
returning column1,column2...
into variable1,variable2...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With