Hi,

I am having the following Oracle procedure which uses a REF cursor as an parameter. Now I want to convert it to Sybase ASE procedure. Can any body help me in this...

Note : A REF Cursor is a cursor variable in which we can assign different select queries at different times.

The following is a Oracle Package which declares a REF cursor type :

create or replace package test_refcur_pkg is
Type refcur is REF cursor;
end test_refcur_pkg;

The following Oracle Procedure uses the ref cursor type as an argument


create or replace procedure test_refcur(input1 IN number, refcurOut OUT test_refcur_pkg.refcur) IS

BEGIN

open refcurOut for select job from employee where empno = input1;

end;


The following Oracle procedure calls the previous procedures and fetches the ref cursor into a variable


create or replace procedure call_refcur
as

job varchar(15);

refcurOut test_refcur_pkg.refcur;

begin

test_refcur(1,refcurOut);

fetch refcurOut into job;

DBMS_OUTPUT.PUT_LINE('The job is ' || job);

end;


Please help me to write the equivalent Sybase ASE procedures ??