The DECLARE statement associates a cursor name with a SELECT statement or a CALL statement. It also allows to define tables and database entities.
EXEC SQL [AT Database]
EXEC SQL [AT Database]
EXEC SQL
EXEC SQL [AT Database]
1. Cursor-Name, Procedure-Name and Prepared-Statement are Nonnumeric Literals, as defined in the Definitions section of the Preface of this document.
2. Select-Statement is a complete SELECT statement.
3. Call-Statement is a CALL statement without the INTO clause.
1. The DECLARE statement must appear in the source before any other statement referencing Cursor-Name, Prepared-Statement, Table-Name and Database.
2. The DECLARE statement can appear in either the working-storage section or in the procedure division.
4. Prepared-Statement must be previously defined by a PREPARE statement.
5. Call-Statement must not use the INTO clause. The INTO clause must be used on OPEN or FETCH of the cursor.
6. The behavior of the WITH clause is database dependent.
a. When the NO phrase is not specified, the cursor may be closed as a consequence of a commit operation.
b. When the NO phrase is specified, the cursor is closed as a consequence of a commit operation.
8.
10. Cursor-Name and Prepared-Statement are bound to the program object instance.
exec sqlexec sqlexec sql
exec sql
| Copyright (c) 2017 Veryant |
| Contact us |
|
Please share your comments on this manual or on any Veryant product documentation with the email button at the top left |