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 Assign a Table Row to a RECORD Variable?
Submitted by: AdministratorIf you have a table, and want to assign a data row of that table to a RECORD variable, you need to define this RECORD variable to match the table column structure, then use the SELECT ... INTO statement to assign a data row that RECORD variable. The script below shows you how to do this:
CREATE OR REPLACE PROCEDURE ggl_CENTER AS
manager employees%ROWTYPE;
BEGIN
SELECT * INTO manager FROM employees
WHERE employee_id = 100;
DBMS_OUTPUT.PUT_LINE('My manager = ' ||
manager.first_name || ' ' || manager.last_name);
END;
/
My manager = Steven King
Submitted by: Administrator
CREATE OR REPLACE PROCEDURE ggl_CENTER AS
manager employees%ROWTYPE;
BEGIN
SELECT * INTO manager FROM employees
WHERE employee_id = 100;
DBMS_OUTPUT.PUT_LINE('My manager = ' ||
manager.first_name || ' ' || manager.last_name);
END;
/
My manager = Steven King
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.