Last active
July 19, 2020 10:05
-
-
Save torstenwerner/d4a27754441c16ce96a85fd68695ed23 to your computer and use it in GitHub Desktop.
Oracle jdbc update with returning clause
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
o0 dbms_sql.varchar2_table; | |
o1 dbms_sql.varchar2_table; | |
c0 sys_refcursor; | |
c1 sys_refcursor; | |
begin | |
update "C##TEST"."AUTHOR" | |
set "C##TEST"."AUTHOR"."FIRST_NAME" = ? | |
where "C##TEST"."AUTHOR"."LAST_NAME" = ? | |
returning "C##TEST"."AUTHOR"."FIRST_NAME", "C##TEST"."AUTHOR"."LAST_NAME" bulk collect into o0, o1; | |
? := sql%rowcount; | |
open c0 for select * from table (o0); | |
open c1 for select * from table (o1); | |
? := c0; | |
? := c1; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to call java.sql.CallableStatement#registerOutParameter(int, int):
Explicit transactions: https://docs.oracle.com/javase/tutorial/jdbc/basics/transactions.html