Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Advanced Oracle PL/SQL Developer's Guide (Second Edition) - Second Edition

You're reading from  Advanced Oracle PL/SQL Developer's Guide (Second Edition) - Second Edition

Product type Book
Published in Feb 2016
Publisher
ISBN-13 9781785284809
Pages 428 pages
Edition 2nd Edition
Languages
Author (1):
Saurabh K. Gupta Saurabh K. Gupta
Profile icon Saurabh K. Gupta

Table of Contents (19) Chapters

Advanced Oracle PL/SQL Developer's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Overview of PL/SQL Programming Concepts Oracle 12c SQL and PL/SQL New Features Designing PL/SQL Code Using Collections Using Advanced Interface Methods Virtual Private Database Oracle SecureFiles Tuning the PL/SQL Code Result Cache Analyzing, Profiling, and Tracing PL/SQL Code Safeguarding PL/SQL Code against SQL injection Working with Oracle SQL Developer Index

Cursor variables


A cursor variable enables a cursor handler to be associated with multiple SQL queries. With respect to functionality, it is similar to an explicit cursor but with certain implementation changes. One of the fundamental differences is that, unlike a cursor, it is a variable of a cursor type. Therefore, it can potentially be referenced in a similar way to other program variables.

As a variable, it can be passed as a parameter to subprograms or used as a return type of a PL/SQL function. Cursor variables can be quite handy when sharing result sets between two subprograms or when a client pulls a data set from the database.

Cursor variables are created by defining a variable of the REF CURSOR type variable or an SYS_REFCURSOR type variable.

Note

Cursor FOR loop does not support cursor variables

The REF CURSOR syntax is as follows:

TYPE [CURSOR VARIABLE NAME] IS REF CURSOR [RETURN (return type)]

In the preceding syntax, the RETURN type of a cursor variable must be a record type. It...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}