Open Statement [Esql] [Sp] - Sybase Adaptive Server Anywhere Reference

Table of Contents

Advertisement

OPEN statement [ESQL] [SP]

OPEN statement [ESQL] [SP]
Function
Syntax
Permissions
Side effects
See also
Description
Parameters
570
Use this statement to open a previously declared cursor to access information
from the database.
OPEN cursor-name
... [ USING [ DESCRIPTOR sqlda-name | host-variable , ...] ]
... [ WITH HOLD ]
... [ ISOLATION LEVEL n ]
... [ BLOCK n ]
cursor-name:
identifier or host-variable
sqlda-name:
identifier
Must have SELECT permission on all tables in a SELECT statement, or
EXECUTE permission on the procedure in a CALL statement.
None.
"DECLARE CURSOR statement" on page 488
"RESUME statement" on page 592
"PREPARE statement" on page 578
"FETCH statement" on page 523
"RESUME statement" on page 592
"CLOSE statement" on page 416
The OPEN statement opens the named cursor. The cursor must be previously
declared.
When the cursor is on a CALL statement, OPEN causes the procedure to
execute until the first result set (SELECT statement with no INTO clause) is
encountered. If the procedure completes and no result set is found, the
SQLSTATE_PROCEDURE_COMPLETE warning is set.
You can also open a cursor on an INSERT statement.
Embedded SQL usage
statement, the sqlerrd[3] field of the SQLCA (SQLIOESTIMATE) is filled
in with an estimate of the number of input/output operations required to fetch
all rows of the query. Also, the sqlerrd[2] field of the SQLCA
(SQLCOUNT) is filled with either the actual number of rows in the cursor (a
value greater than or equal to 0), or an estimate thereof (a negative number
whose absolute value is the estimate). It will be the actual number of rows if
the database server can compute it without counting the rows. The database
can also be configured to always return the actual number of rows (see
"ROW_COUNTS option" on page 208), but this can be expensive.
After successful execution of the OPEN

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Adaptive Server Anywhere and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents