09.01.2015 Views

PL/SQL User's Guide and Reference

PL/SQL User's Guide and Reference

PL/SQL User's Guide and Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

OPEN-FOR-USING Statement<br />

OPEN-FOR-USING Statement<br />

Syntax<br />

The OPEN-FOR-USING statement associates a cursor variable with a multi-row<br />

query, executes the query, identifies the result set, positions the cursor before the<br />

first row in the result set, then zeroes the rows-processed count kept by<br />

%ROWCOUNT. For more information, see "Using the OPEN-FOR, FETCH, <strong>and</strong> CLOSE<br />

Statements" on page 11-7.<br />

open_for_using_statement<br />

OPEN<br />

cursor_variable_name<br />

: host_cursor_variable_name<br />

FOR<br />

dynamic_string<br />

,<br />

USING<br />

bind_argument<br />

;<br />

Keyword <strong>and</strong> Parameter Description<br />

cursor_variable_name<br />

This identifies a weakly typed cursor variable (one without a return type)<br />

previously declared within the current scope.<br />

bind_argument<br />

This is an expression whose value is passed to the dynamic SELECT statement.<br />

dynamic_string<br />

This is a string literal, variable, or expression that represents a multi-row SELECT<br />

statement.<br />

host_cursor_variable_name<br />

This identifies a cursor variable declared in a <strong>PL</strong>/<strong>SQL</strong> host environment <strong>and</strong> passed<br />

to <strong>PL</strong>/<strong>SQL</strong> as a bind variable. The datatype of the host cursor variable is compatible<br />

13-136 <strong>PL</strong>/<strong>SQL</strong> User’s <strong>Guide</strong> <strong>and</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!