Collections:
Assign a Table Row to RECORD Variable in Oracle
How To Assign a Table Row to a RECORD Variable in Oracle?
✍: FYIcenter.com
If 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 FYI_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
⇒ Insert a RECORD into a Table in Oracle
⇐ Define a RECORD Variable for a Table Row in Oracle
2018-08-14, 2191🔥, 0💬
Popular Posts:
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...
Is PL/SQL Language Case Sensitive in Oracle? PL/SQL language is not case sensitive: Reserved words a...
How to change the data type of an existing column with "ALTER TABLE" statements in SQL Server? Somet...
Where to find answers to frequently asked questions on PHP Connections and Query Execution for MySQL...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...