InterviewSolution
Saved Bookmarks
| 1. |
How To Use An Explicit Cursor Without Open Statements? |
|
Answer» f you want to open a CURSOR and loop through its data rows in quick way, you can USE the FOR ... IN ... LOOP statement in the same way as the implicit cursor. The following TUTORIAL exercise gives you a good EXAMPLE: CREATE OR REPLACE PROCEDURE FYI_CENTER AS CURSOR emp_cur IS SELECT * FROM employees WHERE manager_id = 101; BEGIN FOR row IN emp_cur LOOP DBMS_OUTPUT.PUT_LINE('Name = ' || row.first_name || ' ' || row.last_name); END LOOP; END; / Name = Nancy Greenberg Name = Jennifer Whalen Name = Susan Mavris Name = Hermann Baer Name = Shelley Higginsf you want to open a cursor and loop through its data rows in quick way, you can use the FOR ... IN ... LOOP statement in the same way as the implicit cursor. The following tutorial exercise gives you a good example: |
|