We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c869b5 commit 4537b70Copy full SHA for 4537b70
data-platform/core-converged-db/database-23c/23c-basic-examples/update-returning.sql
@@ -0,0 +1,19 @@
1
+REM Script in 23c: update-returning.sql
2
+
3
+SELECT ename, sal FROM emp
4
+WHERE ename = 'KING';
5
6
+-- create variables in SQL*Plus and Update with returning
7
+VARIABLE old_salary NUMBER
8
+VARIABLE new_salary NUMBER
9
10
+UPDATE emp
11
+ SET sal=sal+1000
12
+ WHERE ename = 'KING'
13
+ RETURNING OLD sal, NEW sal into :old_salary, :new_salary;
14
15
+-- check the result
16
+PRINT old_salary
17
+PRINT new_salary
18
19
+rollback;
0 commit comments