Retrieving results with cursor arguments
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Syntax
You can return result rows from stored procedures using
named cursors as arguments. Cursor parameters are OUTPUT parameters
only.
Use the following syntax to retrieve result rows:
|
For example, the following code example returns
rows from the customer table using the cursor named CUST_CURS:
|
The DataServer retrieves the result rows and
places them in a buffer. Specify the Oracle cursor where you want
to fetch and process result rows by using the CURSOR option,
as the following syntax and code example show:
|
|
The previous example code runs the stored procedure, open_cust,
and displays the results fetched from the CUST_CURS cursor.
Note: If multiple cursors are associated with a stored
procedure, you must specify a cursor by name when fetching results,
otherwise the DataServer returns a run-time error. Always specifying
PROC-HANDLE and cursor
parameters ensures that your code continues to run if another cursor parameter
is added to a stored procedure.