marcia1
asked on
How can I sort data within a sys_refcursor
very urgent
i am using an oracle procedure that have an out parameter of sys_refCursor, BUT i need to order the data with in the cursor by one of the attributes in the cursor. How can this be achieved. Attached i am including the PL/SQL
create or replace procedure cursor_test ( v_sql in varchar2 , v_data_set out sys_refcursor)
is
--v_sql varchar2(100) := 'select * from dual';
v_cursor varchar2(25) := 'open v_data_set for ';
v_all_cursor varchar2(1000);
v_mycursor sys_refcursor;
begin
v_all_cursor := v_cursor||v_sql;
OPEN v_data_set FOR v_sql ;
commit;
end;
/
i am using an oracle procedure that have an out parameter of sys_refCursor, BUT i need to order the data with in the cursor by one of the attributes in the cursor. How can this be achieved. Attached i am including the PL/SQL
create or replace procedure cursor_test ( v_sql in varchar2 , v_data_set out sys_refcursor)
is
--v_sql varchar2(100) := 'select * from dual';
v_cursor varchar2(25) := 'open v_data_set for ';
v_all_cursor varchar2(1000);
v_mycursor sys_refcursor;
begin
v_all_cursor := v_cursor||v_sql;
OPEN v_data_set FOR v_sql ;
commit;
end;
/
ASKER
DEAR YANNOS
THANKS FOR YOUR HELP BUT I NEED TO SORT THE DATA AFTER GETTING THE CURSOR NOT DURING THE EXECUTION OF THE CURSOR.
THANKS FOR YOUR HELP BUT I NEED TO SORT THE DATA AFTER GETTING THE CURSOR NOT DURING THE EXECUTION OF THE CURSOR.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
For example
v_sql := 'select * from dual ORDER BY 1';