Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Use an Explicit Cursor without OPEN Statements
How To Use an Explicit Cursor without OPEN Statements? - Oracle DBA FAQ - Working with Cursors in PL/SQL
✍: 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
2007-04-29, 5099👍, 0💬
Popular Posts:
How To Enter Binary Numbers in SQL Statements? - MySQL FAQs - Introduction to SQL Basics If you want...
How To Analyze Tables with "mysqlcheck"? - MySQL FAQs - Administrator Tools for Managing MySQL Serve...
What is NullPointerException and how to handle it? When an object is not initialized, the default va...
How do I install JUnit? First I will download the lastest version of JUnit. Then I will extract all ...
What is DAR (Decision Analysis and Resolution) ? Decision Analysis and Resolution is to analyze poss...