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
⇒ Open Multiple Cursors at the Same Time in Oracle
⇐ Use FETCH Statement in a Loop in Oracle
2018-04-07, 2800🔥, 0💬
Popular Posts:
How to check if two JSON values have overlaps using the JSON_OVERLAPS() function? JSON_OVERLAPS(json...
How to set database to be READ_ONLY in SQL Server? Databases in SQL Server have two update options: ...
How to execute statements in loops in SQL Server Transact-SQL? How to use WHILE ... loops? You can u...
How to download and install Microsoft SQL Server Management Studio Express in SQL Server? Microsoft ...
How To Drop an Index in Oracle? If you don't need an existing index any more, you should delete it w...