Oracle PL/SQL - Can Multiple Cursors Being Opened at the Same Time
Interview Question Database For Software Developers
|
|
| Can Multiple Cursors Being Opened at the Same Time | | Can Multiple Cursors Being Opened at the Same Time? - Oracle DBA FAQ - Working with Cursors in PL/SQL | | By: 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
| | ID: 744 | Rank: 1089 | Votes: 0 | Views: 48 | Submitted: 20070428 |
Copyright © 2009 FYIcenter.com
All rights in the contents of this Website are reserved by the individual author.
No part of the contents may be reproduced in any form without author's permission.
|
|
|