oracle - Is the use of the RETURNING INTO clause faster than a separate SELECT statement? -


1)

update foo set bar = bar + 1 = 123; select bar var foo = 123; 

2)

update foo set bar = bar + 1 = 123 returning bar var; 

i assume second faster appears require 1 less trip database. true?

just thought:

often, applications need information row affected sql operation, example, generate report or take subsequent action. insert, update, , delete statements can include returning clause, returns column values affected row pl/sql variables or host variables. eliminates need select row after insert or update, or before delete. result, fewer network round trips, less server cpu time, fewer cursors, , less server memory required.

taken oracle docs here


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -