Collections:
Open a Cursor Variable in Oracle
How To Open a Cursor Variable in Oracle?
✍: FYIcenter.com
A cursor variable must be opened with a specific query statement before you can fetch data fields from its data rows. To open a cursor variable, you can use the OPEN ... FOR statement as shown in the following tutorial exercise:
CREATE OR REPLACE PROCEDURE FYI_CENTER AS TYPE emp_ref IS REF CURSOR RETURN employees%ROWTYPE; TYPE any_ref IS REF CURSOR; emp_cur emp_ref; any_cur any_ref; sys_cur SYS_REFCURSOR; BEGIN OPEN emp_cur FOR SELECT * FROM employees; OPEN any_cur FOR SELECT * FROM employees; OPEN sys_cur FOR SELECT * FROM employees; CLOSE sys_cur; CLOSE any_cur; CLOSE emp_cur; END; /
2018-07-18, 945👍, 0💬
Popular Posts:
Where to find MySQL database server tutorials? Here is a collection of tutorials, tips and FAQs for ...
How To Get the Definition of a User Defined Function Back in SQL Server Transact-SQL? If you want ge...
What Is Oracle in Oracle? Oracle is a company. Oracle is also a database server, which manages data ...
How To Execute a Stored Procedure in SQL Server Transact-SQL? If you want execute a stored procedure...
Where to find answers to frequently asked questions on SQL Transaction Management in Oracle? Here is...