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
⇒ Pass a Parameter to a Cursor in Oracle
⇐ Use an Explicit Cursor without OPEN Statements in Oracle
2018-04-07, 3905🔥, 0💬
Popular Posts:
How To Get the Definition of a View Out of the SQL Server in SQL Server? If you want get the definit...
How To Revise and Re-Run the Last SQL Command in Oracle? If executed a long SQL statement, found a m...
What Are the Differences between BINARY and VARBINARY in MySQL? Both BINARY and VARBINARY are both b...
How to download and install Microsoft SQL Server Management Studio Express in SQL Server? Microsoft ...
Can Date and Time Values Be Converted into Integers in SQL Server Transact-SQL? Can date and time va...