Home » RDBMS Server » Server Administration » REF CURSOR parameter
REF CURSOR parameter [message #369688] Tue, 15 August 2000 21:23 Go to next message
S Kaza
Messages: 2
Registered: August 2000
Junior Member
Can a REF CURSOR be just OUT parameter (instead of IN OUT) ?.

When I try to create a SP which has REF CURSOR parameter as OUT, I'm getting the following error.

PLS-00361:A cursor variable must be IN OUT to be OPENed.

Example:

PROCEDURE GetEmpRecords(indeptno IN NUMBER,
p_errorcode OUT NUMBER,
p_cursor OUT empcur)
IS
BEGIN
p_errorcode := 0;
OPEN p_cursor FOR SELECT * FROM emp WHERE deptno = indeptno ORDER BY ename;
EXCEPTION
WHEN OTHERS THEN
p_errorcode := SQLCODE;
END GetEmpRecords;
Re: REF CURSOR parameter [message #369689 is a reply to message #369688] Wed, 16 August 2000 03:09 Go to previous messageGo to next message
PC
Messages: 6
Registered: August 2000
Junior Member
Make the parameter p_cursor as first parameter in your procedure and define it as a IN OUT parameter.
Re: REF CURSOR parameter [message #369691 is a reply to message #369688] Wed, 16 August 2000 08:02 Go to previous messageGo to next message
S Kaza
Messages: 2
Registered: August 2000
Junior Member
My question is, is it possible to declare REF CURSOR param as OUT (not IN OUT) and open it in the code, whithout getting any errors.

thanks in advance
Re: REF CURSOR parameter [message #369695 is a reply to message #369688] Wed, 16 August 2000 17:12 Go to previous message
Priyadarshini
Messages: 10
Registered: July 2000
Junior Member
In the above example can you tell me what 'empcur' datatype is????
Previous Topic: ALTER TABLE DROP COLUMN does not work correctly
Next Topic: Re: Final Word on Result Sets (?)
Goto Forum:
  


Current Time: Fri Oct 30 03:09:56 CDT 2020