Can someone tell me how to massage insert data from ref cursor into temporary table in PL / SQL? I have a procedure in which one of its parameters stores the result set, this result set will be inserted into the temporary table in another stored procedure.
This is my sample code.
CREATE OR REPLACE PROCEDURE get_account_list ( type_id in account_type.account_type_id%type, acc_list out sys_refcursor ) is begin open acc_list for select account_id, account_name, balance from account where account_type_id = type_id; end get_account_list; CREATE OR REPLACE PROCEDURE proc1 ( ... ) is accounts sys_refcursor; begin get_account_list(1, accounts);
In SQL Server, I can write the code below
CREATE PROCEDURE get_account_list type_id int as select account_id, account_name, balance from account where account_type_id = type_id; CREATE PROCEDURE proc1 ( ... ) as ... insert into
How to write code similar to SQL Server code? Thanks.
sql oracle plsql sql-server tsql
Sambath prum
source share