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, 2695🔥, 0💬
Popular Posts:
How To Concatenate Two Character Strings Together in SQL Server Transact-SQL? Concatenating two char...
How To Generate CREATE TABLE Script on an Existing Table in SQL Server? If you want to know how an e...
How To Convert Characters to Numbers in Oracle? You can convert characters to numbers by using the T...
How Run SQL*Plus Commands That Are Stored in a Local File in Oracle? If you have a group of commands...
How Run SQL*Plus Commands That Are Stored in a Local File in Oracle? If you have a group of commands...