Using function returning cursor

Vox

Member
Hi,

Is there any way to use in TOracleDataset such a function:

Code:
FUNCTION PTEST3 return sys_refcursor
IS
  res sys_refcursor;
begin
  open res for select * from test1;
  return res;
END;
I know, i can use an equivalent:

Code:
PROCEDURE PTEST4 (result in out sys_refcursor)
IS
  res sys_refcursor;
begin
  open res for select * from test1;
  result := res;
END;
with this SQL

Code:
_cursor.SQl.Text := 'call ptest4(:result)'
But i want a function :)

Thanks.
 
Sure, you can do this in the SQL.Text of a dataset:

Code:
begin
  :ptest3_cursor := ptest3;
end;
Declare :ptest3_cursor as a cursor variable, and you're done.
 
Oh, thank you, it works!

I just tried to use this SQL

Code:
call ptest3 into :result
it works with simple variables, but doesn't works with cursors.
 
Back
Top