NUMBER 5 0 amount needed CONSTANT NUMBER 5 1000 bins looked The Open Group it exam at NUMBER 3 0 BEGIN OPEN bin cur 5469 WHILE total so far amount needed LOOP FETCH bin cur INTO bin amt EXIT WHEN bin cur NOTFOUND if we exit, there s not enough to fill the order bins looked at bins looked at 1 IF total so far bin amt amount needed THEN UPDATE bins SET amt in bin 0 WHERE CURRENT OF bin cur take everything in the bin total so far total so The Open Group far bin amt ELSE we finally have enough UPDATE bins SET amt in bin amt in bin amount needed total so far WHERE CURRENT OF bin cur total so far amount needed END IF END LOOP CLOSE bin cur INSERT INTO temp VALUES NULL, bins looked at, bins looked at COMMIT END Overview of Implicit Cursor Attributes Implicit cursor attributes return information about the execution of an INSERT, UPDATE, DELETE, or SELECT INTO statement. The values of the cursor attributes always refer to the most recently The Open Group Certification executed SQL statement. Before Oracle opens the SQL cursor, the implicit cursor attributes yield NULL. Note The SQL cursor has another attribute, BULK ROWCOUNT, designed for use with the FORALL statement. For more information, see Counting Rows Affected by FORALL It.