I need to insert values returned by a stored procedure into a table. My stored procedure consist of multiple select statements and unions, something like this:
create or replace
PROCEDURE "my_str_proc" (
emp_code IN VARCHAR2,
hired_year IN VARCHAR2,
q_bio OUT SYS_REFCURSOR)
AS
BEGIN
OPEN q_bio FOR
select column list from table_1 where....and...
UNION
select column list from table_2 where....and...
UNION
select column list from table_3 where....and...
UNION
select column list from table_4 where....and...
ORDER BY hired_year;
RETURN;
/* I plan to add the following statement to the existing proedure script:*/
/* How can I get the return values after the procedure is done running
and inserted into a table ? */
INSERT INTO Report_table (col1,col2,col3,col4,col5,col6,col7,col8,col9)
VALUES (?????)
END;
How can I write the script so the values returned by the procedure at the end got inserted into a table that I have created. I can't find the script example and I'm new with Oracle. Our Oracle is 11g
insert as select ...
– hakiq_bio OUT SYS_REFCURSOR
– Bob Jarvis - Reinstate Monica