You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to single RETURNING clauses, it would be also very useful to support UPDATE and DELETE .. RETURNING for multi-row DML statements. This is possible with PL/SQL
UPDATE t SET x =1WHERE1=1 RETURNING y BULK COLLECT INTO ?;
Or more specifically:
declare
t0 dbms_sql.number_table;
t1 dbms_sql.date_table;
c0 sys_refcursor;
c1 sys_refcursor;
beginupdate"TEST"."T_2155"set"TEST"."T_2155"."D1"=date'2003-03-03'
returning
"TEST"."T_2155"."ID",
"TEST"."T_2155"."D1"
bulk collect into t0, t1;
? := sql%rowcount;
open c0 for select*from table(t0);
open c1 for select*from table(t1);
? := c0;
? := c1;
end;
The difficulty is to have nominal TABLE types that must be generated ad-hoc for this query prior to executing the query.
An alternative is to use the PL/SQL TABLE types from DBMS_SQL to serialise the individual columns through individual SYS_REFCURSOR result values.
lukaseder
changed the title
Emulate multi-row UPDATE and DELETE RETURNING for Oracle using PL/SQL RETURNING .. BULK COLLECT INTO
Support multi-row UPDATE and DELETE RETURNING for Oracle using PL/SQL RETURNING .. BULK COLLECT INTO
Apr 5, 2016
In addition to single
RETURNING
clauses, it would be also very useful to supportUPDATE
andDELETE .. RETURNING
for multi-row DML statements. This is possible with PL/SQLOr more specifically:
The difficulty is to have nominal
TABLE
types that must be generated ad-hoc for this query prior to executing the query.An alternative is to use the PL/SQL
TABLE
types fromDBMS_SQL
to serialise the individual columns through individualSYS_REFCURSOR
result values.See also: #5190
The text was updated successfully, but these errors were encountered: