Declaring a Cursor v12
In order to use a cursor, it must first be declared in the declaration section of the SPL program. A cursor declaration appears as follows:
name
is an identifier that will be used to reference the cursor and its result set later in the program. query
is a SQL SELECT
command that determines the result set retrievable by the cursor.
Note
An extension of this syntax allows the use of parameters. This is discussed in more detail in Parameterized Cursors.
The following are some examples of cursor declarations: