Previous Topic: DECLARE CURSORNext Topic: DELETE


DECLARE EXTERNAL CURSOR

The DECLARE EXTERNAL CURSOR data manipulation statement identifies an externally-defined global cursor to be used by the application program. You can use this statement only in SQL that is embedded in a program. The DECLARE EXTERNAL CURSOR statement is a CA IDMS extension of the SQL standard.

Authorization

None required.

Syntax
►►─── DECLARE static-cursor-name EXTERNAL CURSOR ─────────────────────────────►◄
Parameter
static-cursor-name

Specifies the name of a global cursor to be used by the application program. Static-cursor-name must identify a cursor defined by a DECLARE CURSOR statement with the GLOBAL option in another application program that shares an access module with the program containing the DECLARE EXTERNAL CURSOR statement.

Usage

Sharing Cursors

For one program (program B) to use a cursor defined in another program (program A):

Example

Identifying an Externally Defined Global Cursor

The following DECLARE EXTERNAL CURSOR statement identifies ALL_EMP_CURSOR as an externally defined global cursor that is used in the application program:

EXEC SQL
   DECLARE ALL_EMP_CURSOR EXTERNAL CURSOR
END-EXEC
More Information