8. SQL Statements : CLOSE : CLOSE Example
 
Share this page                  
CLOSE Example
The following example illustrates cursor processing from cursor declaration to closing:
EXEC SQL DECLARE c1 CURSOR FOR
SELECT ename, jobid
FROM employee
WHERE jobid = 1000;
...
EXEC OPEN c1;
LOOP UNTIL NO MORE ROWS;
EXEC SQL FETCH c1
     INTO :name, :jobid;
PRINT NAME, jobid;
END LOOP;

EXEC SQL CLOSE c1;