Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: **PLEASE HELP** Oracle Stored Procedures question

Re: **PLEASE HELP** Oracle Stored Procedures question

From: Ian Sparkes <sparkes_at_sprintmail.com>
Date: 1997/05/21
Message-ID: <01bc6579$e834e4c0$748285ce@sprintmail>#1/1

Could you solve this problem by using a package ?

Create a global variable in the package to determine the state of the cursor. Initialize this variable to "closed". Global variables will persist for the entire transaction regardless of how many times you call the procedure.

Define function (within the package) get_data which returns one row of data, with the cursor status as it's value (or a proc with an extra out parameter).

get_data would look something like this. (pseudo code)

If cursor not open -- Test Global Variable Then

	Open cursor
	set cursor status variable = open

fetch data

If last row then

	close cursor
 	return last row status
else
	return more data status

exit Received on Wed May 21 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US