Kbase P47514: How to handle the output from an interactive SELECT statement ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  8/14/2004 |
|
Status: Unverified
GOAL:
How to handle the output from an interactive SELECT statement ?
GOAL:
How to use the FETCH and CURSOR statement in 4GL ?
FIX:
The SELECT statement itself does not allow the user to stop the display of the information.
To be able to process the data retrieved from an Interactive SELECT statement you need to define a cursor.
This is a sample code :
DEFINE VARIABLE cName as CHAR FORMAT "X(30)".
DEFINE VARIABLE cNumber AS INTEGER.
DECLARE myCursor CURSOR FOR SELECT name,custnum FROM customer.
OPEN myCursor.
REPEAT:
FETCH myCursor INTO cName, cNumber.
DISPLAY cName, cNumber. /* Process data here */
END.
CLOSE myCursor.