EXEC SQL [ AT Database ] OPEN { Cursor-Name } [ USING Host-Variable, ... ] [ INTO Host-Variable, ... ] { Host-Var } END-EXEC |
EXEC SQL [ AT Database ] OPEN { Cursor-Name } [ USING DESCRIPTOR Sql-Descriptor ] { Host-Var } END-EXEC |
exec sql declare cust_cur cursor for select * from customers end-exec exec sql open cust_cur end-exec perform until 1 = 2 exec sql fetch next cust_cur into :ws-cust-code, :ws-cust-name end-exec display "code: " ws-cust-code " name: " ws-cust-name if sqlcode = 100 exit perform end-if end-perform exec sql close cust_cur end-exec |