sys_refcursor for the dataset
1 TopicGetting data using Procedure by using the SYS_REFCURSOR.
Have a Oracle procedure, which will insert data to the global temparary table and selecting the data from the table using SYS_REFCURSOR as the output parameter. My procedure is as below CREATE OR REPLACE PROCEDURE DORIS.XYZ( prBeginDate IN Varchar2 := '2024', pGroupID IN Varchar2:= NULL , c_direct_reports OUT SYS_REFCURSOR) AS BEGIN Insert into Sub_ids_list_xyz values ('10002521' ); OPEN c_direct_reports FOR select * from Sub_ids_list_xyz; END; / Calling the procedure as below in the Text in the Query Type Declare xx SYS_REFCURSOR; Begin DORIS.XYZ( '2024', NULL , xx); DBMS_SQL.RETURN_RESULT(xx); End; I am getting blow error while running ORA-08103: object no longer exists ---------------------------- Cannot read the next data row for the dataset 'DataSet1'. My actual requirment is to populate the items in the tempary table and use the temp table in the subqurey for IN clause. The Sp is working fine in Toad. SobhaSolved3.9KViews0likes12Comments