Collections:
Use an Explicit Cursor without OPEN Statements in Oracle
How To Use an Explicit Cursor without OPEN Statements in Oracle?
✍: FYIcenter.com
If 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 Higgins
2018-04-07, 899👍, 0💬
Popular Posts:
Where to find SQL Server database server tutorials? Here is a collection of tutorials, tips and FAQs...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...
What Do You Need to Connect PHP to MySQL in MySQL? If you want to access MySQL database server in yo...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
How To Change the Name of a Database User in SQL Server? If you want to change the name of an existi...