Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> passing cursor vars to other procedures
Hi,
I am trying to modularize a stored procedure. It works fine, but's it's getting pretty large and has a lot of redundant code, so I'm trying to take alot of the code and put it into separate procedures which I will then call from this main procedure. This is purely for modularization and I don't desire to return any resultsets back to a calling application.
I'm having some trouble achieving my desired result and am hoping someone could assist.
The procedure's declaration area declares 5 cursors in the format:
cursor [name] is select ... from ... where... ; r1 [name]%rowtype;
The body of the procedure opens the cursors, fetches the rows and processes them. I'm trying to replace this entire block of code with a call to another procedure in which I pass to that procedure a cursor variable. I tried the obvious approach of simply passing the cursor variable and on the other side, declaring the procedure with an in parameter that was a cursor. This didn't work.
I was just reading the pl/sql users manual and all examples the had of cursors being passed between procedures involved the use of packages. Do I have to use a package in order to pass a cursor variable to another procedure? If not, can someone provide an example because I can't seem to get it to work.
Thanks for any help,
Gavin
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Nov 15 2000 - 16:26:20 CST