sqlserver to oracle port - multiple ref cursor problem.
Hi,
We are working on an oracle port project where in the application is being moved from sql server database to oracle, without effecting the front end code a bit...which means..I need to do in oracle what happens in sqlserver ...DITTO.
Now I have 1 scenario which I am not sure how to go about with.
SQLSERVER has this funda of of returing recordsets to front end just by using a select statement.eg...
Code:
create proc test
begin
select empname,empno from emp
end
/
this would return a recordset to front end..
In oracle I need to use ref cursor's for this...
But there are some places where in I have something like this in sqlserver
Code:
CREATE PROC totalshyt
BEGIN
DECLARE c1 CURSOR FOR
SELECT empno,empname FROM emp
OPEN AND FETCH THE CURSOR
SELECT empsomething FROM address WHERE empname=@c1.empname
CLOSE CURSOR
END
/
Now I am not really sure how many select's are going to be in cursor before hand...so the count of ref-cursor's is unknown.
Can anyone please let me know how to go about with this?
Thanks
Sam