Collections:
Open Multiple Cursors at the Same Time in Oracle
Can Multiple Cursors Being Opened at the Same Time in Oracle?
✍: FYIcenter.com
Yes, multiple cursors can be opened at the same time. See the following example:
CREATE OR REPLACE PROCEDURE FYI_CENTER AS CURSOR emp_cur IS SELECT * FROM employees; emp_rec employees%ROWTYPE; CURSOR dpt_cur IS SELECT * FROM departments; dpt_rec departments%ROWTYPE; BEGIN OPEN emp_cur; OPEN dpt_cur; FETCH emp_cur INTO emp_rec; FETCH dpt_cur INTO dpt_rec; DBMS_OUTPUT.PUT_LINE('Department name = ' || dpt_rec.department_name); DBMS_OUTPUT.PUT_LINE('Employee name = ' || emp_rec.first_name || ' ' || emp_rec.last_name); CLOSE emp_cur; CLOSE dpt_cur; END; / Department name = Administration Employee name = Steven King
2018-04-07, 976👍, 0💬
Popular Posts:
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
What Is Open Database Communication (ODBC) in Oracle? ODBC, Open Database Communication, a standard ...
What Do You Need to Connect PHP to MySQL in MySQL? If you want to access MySQL database server in yo...
How To Install PHP on Windows in MySQL? The best way to download and install PHP on Windows systems ...