Declaring a cursor v16
Before you can use a cursor, you must first declare it in the declaration section of the SPL program. A cursor declaration appears as follows:
nameis an identifier used to reference the cursor and its result set later in the program.
queryis a SQL
SELECTcommand that determines the result set retrievable by the cursor.
An extension of this syntax allows the use of parameters. For details, see Parameterized cursors.
This example shows some cursor declarations: