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
LNPLS01333

OPEN FOR Statement

The OPEN FOR statement associates a cursor variable with a query, allocates database resources to process the query, identifies the result set, and positions the cursor before the first row of the result set. If the query has a FOR UPDATE clause, then the OPEN FOR statement locks the rows of the result set.

LNPLS1700Topics

Syntax

LNPLS1263open_for_statement ::=

Description of open_for_statement.gif follows
Description of the illustration open_for_statement.gif

LNPLS1264using_clause ::=

Description of using_clause.gif follows
Description of the illustration using_clause.gif

Semantics

LNPLS1701open_for_statement

LNPLS1265cursor_variable

Name of a cursor variable. If cursor_variable is the formal parameter of a subprogram, then it must not have a return type. For information about cursor variables as subprogram parameters, see "Cursor Variables as Subprogram Parameters".

LNPLS1266:host_cursor_variable

Name of a cursor variable that was declared in a PL/SQL host environment and passed to PL/SQL as a bind variable. Do not put space between the colon (:) and host_cursor_variable.

The data type of a host cursor variable is compatible with the return type of any PL/SQL cursor variable.

LNPLS1709select_statement

SQL SELECT statement (not a PL/SQL SELECT INTO statement). Typically, select_statement returns multiple rows.

See:

Oracle Database SQL Language Reference for SELECT statement syntax

LNPLS1745dynamic_string

String literal, string variable, or string expression of the data type CHAR, VARCHAR2, or CLOB, which represents a SQL SELECT statement. Typically, dynamic_statement represents a SQL SELECT statement that returns multiple rows.

LNPLS1746using_clause

Specifies bind variables.

LNPLS1747Restrictions on using_clause 

LNPLS1270bind_argument

Expression whose value replaces its corresponding placeholder in select_statement or dynamic_string at run time. You must specify a bind_argument for every placeholder.

LNPLS1749IN, OUT, IN OUT

Parameter modes of bind variables. An IN bind variable passes its value to the select_statement or dynamic_string. An OUT bind variable stores a value that dynamic_string returns. An IN OUT bind variable passes its initial value to dynamic_string and stores a value that dynamic_string returns. Default: IN.

Examples

Related Topics

LNPLS1750In this chapter:

LNPLS1760In 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