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
2018-08-14, 789👍, 0💬
Popular Posts:
How To Provide Values to Stored Procedure Parameters in SQL Server Transact-SQL? If a stored procedu...
How To Create a Stored Program Unit in Oracle? If you want to create a stored program unit, you can ...
How To List All Stored Procedures in the Current Database in SQL Server Transact-SQL? If you want to...
How To Create a View on an Existing Table in SQL Server? If you want to a view on an existing table,...
How to download and install SQL Server 2005 Sample Scripts in SQL Server? If you want to learn from ...