Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews DB Oracle Interviews:Concepts and ArchitectureData AccessDatabase ArchitectureDatabase ManagementDatabase Security OracleDistributed ProcessingFlexfieldForms ReportsGeneral OracleMemory ManagementMTO-SAP Financial AccountingOCIOracle AOLOracle AROracle Backup RecoveryOracle D2KOracle DatabaseOracle Database DeveloperOracle DB OptimizationOracle DBAOracle DeveloperOracle ETLOracle Forms 3.0Oracle Forms 4.0Oracle GLOracle PL-SQLOracle RMANOracle ScenariosOracle SecurityOracle SQLOracle System ArchitectureOracle Technology Network (OTN)Programmatic ConstructsRAC (Real Application Clusters)SQL Plus
Copyright © 2018. All Rights Reserved
Oracle Database Interview Question:
Can Multiple Cursors Being Opened at the Same Time?
Submitted by: AdministratorYes, multiple cursors can be opened at the same time. See the following example:
CREATE OR REPLACE PROCEDURE ggl_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
Submitted by: Administrator
CREATE OR REPLACE PROCEDURE ggl_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
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.