Progress
Embedded SQL-92
Guide and Reference
OPEN a Cursor
You open a cursor with the OPEN statement. When you open a cursor, the database executes the SELECT statement associated with the cursor. The rows retrieved as a result of the execution form the active set.
This is the syntax for an OPEN statement:
EXAMPLE
The following code fragment illustrates how to use an OPEN statement:
The OPEN statement sets the cursor to the open state. When the database processes an OPEN statement, it executes the statement using the current values of program variables. The cursor now points just before the first row of the resulting active set. While the cursor is in the open state, subsequent changes to any program variables that appear in the SELECT statement associated with the cursor do not affect the active set.
OPEN cursor_name does not use the values in associated input host variables after the cursor is opened. This means the result of the query is not affected if the variable values change after the cursor is opened, while it remains open. To reflect changes to host variables in query results, you must close and reopen the cursor.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |