Difference between revisions of "OPEN"

From Lianjapedia
Jump to: navigation, search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
''[[OPEN Commands|OPEN ... commands]]''
 +
 
==Purpose==
 
==Purpose==
 
Opens a pointer to a logical table
 
Opens a pointer to a logical table
Line 9: Line 11:
  
 
==Description==
 
==Description==
The OPEN statement opens a cursor (a pointer to a logical table) that has been declared with the DECLARE CURSOR statement.  The DECLARE CURSOR statement declares a cursor which may be processed in an application program.  A logical table is a temporary collection of data that satisfies conditions specified in a SELECT statement.  Once a declared cursor has been opened, the FETCH statement may be used to obtain values from the rows of its logical table.  The CLOSE statement is used to close an open cursor.  Cursors may be opened and closed repeatedly until the cursor is released with the DROP CURSOR statement.  Cursors are also released when RECITAL is exited.  The OPEN statement opens the cursor on the first row of its logical table, regardless of which row it was on when last closed.
+
The OPEN statement opens a cursor (a pointer to a logical table) that has been declared with the DECLARE CURSOR statement.  The DECLARE CURSOR statement declares a cursor which may be processed in an application program.  A logical table is a temporary collection of data that satisfies conditions specified in a SELECT statement.  Once a declared cursor has been opened, the FETCH statement may be used to obtain values from the rows of its logical table.  The CLOSE statement is used to close an open cursor.  Cursors may be opened and closed repeatedly until the cursor is released with the DROP CURSOR statement or the session is exited.  The OPEN statement opens the cursor on the first row of its logical table, regardless of which row it was on when last closed.
  
 
This command can only be used in Embedded SQL.  The cursor must already be declared.
 
This command can only be used in Embedded SQL.  The cursor must already be declared.
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
 
!Keywords||Description
 
!Keywords||Description
 
|-
 
|-

Latest revision as of 10:04, 3 August 2016

OPEN ... commands

Purpose

Opens a pointer to a logical table

Syntax

OPEN <cursor>

See Also

CLOSE, DECLARE CURSOR, DROP CURSOR, FETCH

Description

The OPEN statement opens a cursor (a pointer to a logical table) that has been declared with the DECLARE CURSOR statement. The DECLARE CURSOR statement declares a cursor which may be processed in an application program. A logical table is a temporary collection of data that satisfies conditions specified in a SELECT statement. Once a declared cursor has been opened, the FETCH statement may be used to obtain values from the rows of its logical table. The CLOSE statement is used to close an open cursor. Cursors may be opened and closed repeatedly until the cursor is released with the DROP CURSOR statement or the session is exited. The OPEN statement opens the cursor on the first row of its logical table, regardless of which row it was on when last closed.

This command can only be used in Embedded SQL. The cursor must already be declared.

Keywords Description
cursor The name of the cursor to be opened.

Example

OPEN accounts