Collections:
Retrieve Data from a Cursor to a RECORD in Oracle
How To Retrieve Data from a Cursor to a RECORD in Oracle?
✍: FYIcenter.com
If you have a cursor opened ready to use, you can also use the FETCH statement to retrieve data from the cursor into a RECORD variable as shown in the tutorial exercise below:
CREATE OR REPLACE PROCEDURE FYI_CENTER AS CURSOR t_list IS SELECT first_name, last_name FROM employees; TYPE name_rec IS RECORD ( f_name VARCHAR2(10), l_name VARCHAR2(10) ); n name_rec; BEGIN OPEN t_list; FETCH t_list INTO n; DBMS_OUTPUT.PUT_LINE('Name = ' || n.f_name || ' ' || n.l_name); FETCH t_list INTO n; DBMS_OUTPUT.PUT_LINE('Name = ' || n.f_name || ' ' || n.l_name); CLOSE t_list; END; / Name = Ellen Abel Name = Sundar Ande
⇒ Use FETCH Statement in a Loop in Oracle
⇐ Retrieve Data from an Explicit Cursor in Oracle
2018-07-22, 1574🔥, 0💬
Popular Posts:
How To Use GO Command in "sqlcmd" in SQL Server? "sqlcmd" is a command line client application to ru...
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in SQL Server? Sometimes, y...
Where to find SQL Server database server tutorials? Here is a collection of tutorials, tips and FAQs...
How To Turn on mysql Extension on the PHP Engine in MySQL? The "mysql" API extension is provided as ...
How To Find Out What Privileges a User Currently Has in Oracle? Privileges granted to users are list...