>>-OPEN--+-cursor_id------------+-------------------------------> | (1) | '--------cursor_id_var-' >--+-----------------------------------------------+------------> | .-,-------------. | | V | | '-USING--+---parameter_var-+------------------+-' +-SQL DESCRIPTOR--+-'descriptor '--+-+ | '-descriptor_var-' | '-DESCRIPTOR--sqlda_pointer----------' >--+----------------------------+------------------------------>< | (1) | '--------WITH REOPTIMIZATION-'
Element | Description | Restrictions | Syntax |
---|---|---|---|
cursor_id | Name of a cursor | Must have been declared | Identifier |
cursor_id_var | Host variable = cursor_id | Must be a character data type | Language specific |
descriptor | Name of a system-descriptor area | Must have been allocated | Quoted String |
descriptor_var | Host variable that identifies the system-descriptor area | System-descriptor area must have been allocated | Quoted String |
parameter_var | Host variable whose contents replace a question ( ? ) mark placeholder in a prepared statement | Must be a character or collection data type | Language specific |
sqlda_pointer | Pointer to sqlda structure defining data type and memory location of values to replace question ( ? ) marks in a prepared statement | Cannot begin with a dollar ( $ ) sign nor with a colon ( : ). You must use an sqlda structure with dynamic SQL statements. | DESCRIBE |
A cursor is a database object that can contain an ordered set of values. The OPEN statement activates a cursor that the DECLARE statement created.
Cursor can be classified by their associated SQL statements:
The specific actions that the database server takes differ, depending on the statement with which the cursor is associated. When you associate one of the previous statements with a cursor directly (that is, you do not prepare the statement and associate the statement identifier with the cursor), the OPEN statement implicitly prepares the statement.
In an ANSI-compliant database, you receive an error code if you try to open a cursor that is already open.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]