In SQL server it is possible to have execute an INSERT statement as given below :
INSERT INTO table_name EXECUTE proc_name(arg)
Here, the Stored Procedure proc_name(arg) would return a Cursor which is used to populate data in the table.
Is there a direct way of doing the same in Oracle ?
One solution is to declare a REF CURSOR output variable, send it to proc_name as a parameter and use the same to populate the table once the procedure is executed. Now once the Ref Cursor has the data, what is the simplest way of inserting the data into the table. Iterate through each and every RECORD in the REF CURSOR and then perform inserts one row at a time ?