Consultor Eletrônico



Kbase 18681: Sample Program - How To Use A SQL Cursor From Progress 4GL
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

This solution provides a sample program which demonstrates how to use a SQL cursor in a Progress 4GL program.

FIX:


DEFINE VARIABLE v-c LIKE customer.cust-num NO-UNDO.
DEFINE VARIABLE v-n LIKE customer.name NO-UNDO.

DECLARE c01 CURSOR FOR SELECT cust-num, name FROM customer WHERE cust-num < 5.

OPEN c01.

REPEAT:
FETCH c01 INTO v-c, v-n.
DISPLAY v-c v-n.
END.

Using Progress 4GL, the above code is equivalent to:

FOR EACH customer WHERE cust-num < 5:
DISPLAY cust-num name.
END.