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:
How To Define an Oracle Cursor Variable?
Submitted by: AdministratorTo define cursor variable, you must decide which REF CURSOR data type to use. There are 3 ways to select a REF CURSOR data type:
► Define your own specific REF CURSOR types using the TYPE ... RETURN statement.
► Define your own generic REF CURSOR type using the TYPE ... statement.
► Use the system defined REF CURSOR type: SYS_REFCURSOR.
The follwoing tutorial exercise defines 3 cursor variables in 3 different ways:
CREATE OR REPLACE PROCEDURE ggl_CENTER AS
TYPE emp_ref IS REF CURSOR RETURN employees%ROWTYPE;
TYPE any_ref IS REF CURSOR;
emp_cur emp_ref;
any_cur any_ref;
sys_cur SYS_REFCURSOR;
BEGIN
NULL;
END;
/
Submitted by: Administrator
► Define your own specific REF CURSOR types using the TYPE ... RETURN statement.
► Define your own generic REF CURSOR type using the TYPE ... statement.
► Use the system defined REF CURSOR type: SYS_REFCURSOR.
The follwoing tutorial exercise defines 3 cursor variables in 3 different ways:
CREATE OR REPLACE PROCEDURE ggl_CENTER AS
TYPE emp_ref IS REF CURSOR RETURN employees%ROWTYPE;
TYPE any_ref IS REF CURSOR;
emp_cur emp_ref;
any_cur any_ref;
sys_cur SYS_REFCURSOR;
BEGIN
NULL;
END;
/
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.