Skip Headers
Oracle® Database PL/SQL Language Reference
11g Release 2 (11.2)

Part Number E25519-05
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub
LNPLS01312

Cursor Variable Declaration

A cursor variable is like an explicit cursor that is not limited to one query.

To create a cursor variable, either declare a variable of the predefined type SYS_REFCURSOR or define a REF CURSOR type and then declare a variable of that type.

LNPLS1165Restrictions on Cursor Variables

LNPLS1166Topics

Syntax

LNPLS1046ref_cursor_type_definition ::=

Description of ref_cursor_type_definition.gif follows
Description of the illustration ref_cursor_type_definition.gif

LNPLS1047cursor_variable_declaration ::=

Description of cursor_variable_declaration.gif follows
Description of the illustration cursor_variable_declaration.gif

Semantics

LNPLS1167ref_cursor_type_definition

LNPLS1168type

Name of the REF CURSOR type that you are defining.

LNPLS1169RETURN

Specifies the data type of the value that the cursor variable returns.

Specify RETURN to define a strong REF CURSOR type. Omit RETURN to define a weak REF CURSOR type. For information about strong and weak REF CURSOR types, see "Creating Cursor Variables".

LNPLS1170db_table_or_view

Name of a database table or view, which must be accessible when the declaration is elaborated.

LNPLS1173cursor

Name of a previously declared explicit cursor.

LNPLS1174cursor_variable

Name of a previously declared cursor variable.

LNPLS1175record

Name of a user-defined record.

LNPLS1176record_type

Name of a user-defined type that was defined with the data type specifier RECORD.

LNPLS1177ref_cursor_type

Name of a user-defined type that was defined with the data type specifier REF CURSOR.

LNPLS1178cursor_variable_declaration

LNPLS1179cursor_variable

Name of the cursor variable that you are declaring.

LNPLS1184type

Type of the cursor variable that you are declaring—either SYS_REFCURSOR or the name of the REF CURSOR type that you defined previously.

SYS_REFCURSOR is a weak type. For information about strong and weak REF CURSOR types, see "Creating Cursor Variables".

Examples

Related Topics

LNPLS1185In this chapter:

LNPLS1186In other chapters:

Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF