Issue a FETCH statement to retrieve the values in the row currently occupied by a cursor. Usually this statement is executed within a loop controlled by the SQLCODE variable so that the SQL server processes each row accessed by a cursor and exits the loop when the end of the table is detected.
LSQL FETCH cursorname INTO (hostvarlist )
The name of the cursor from which you are retrieving values.
A set of host variable names in which to store the selected column values.
Specify a name for each column defined in the SELECT clause of the DECLARE CURSOR statement in the appropriate order.
Note: If you do not specify a host variable for each column defined in the cursor, the statement executes and a warning message is returned.
Example
To retrieve the values from the example cursor called STATDOWN, issue this LSQL command from a CLIST:
LSQL FETCH STATDOWN INTO (:APPLID,:UPDATE,:STATUS)
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |