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; /
⇒ Loop through a Cursor Variable in Oracle
⇐ Define a Cursor Variable in Oracle
2018-07-18, 2797🔥, 0💬
Popular Posts:
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...
What Is an Oracle Instance in Oracle? Every running Oracle database is associated with an Oracle ins...
How to download Microsoft SQL Server 2005 Express Edition in SQL Server? Microsoft SQL Server 2005 E...
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...