UrbanPro
true

Learn PL/SQL from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Pl SQL Cursors

Madhulika N.
27/09/2017 0 0
  • To process an SQL statement, ORACLE needs to create an area of memory known as the context area; this will have the information needed to process the statement.
  • This information includes the number of rows processed by the statement, a pointer to the parsed representation of the statement.
  • In a query, the active set refers to the rows that will be returned.
  • A cursor is a handle, or pointer, to the context area.
  • Through the cursor, a PL/SQL program can control the context area and what happens to it as the statement is processed.
  • Two important features about the cursor are
  • 1.Cursors allow you to fetch and process rows returned by a SELECT statement, one row at a time.

  • There are two types of cursors:

  • 1.An IMPLICIT cursor is automatically declared by Oracle every time an SQL statement is executed. The user will not be aware of this happening and will not be able to control or process the information in an implicit cursor.

    2.An EXPLICIT cursor is defined by the program for any query that returns more than one row of data. That means the programmer has declared the cursor within the PL/SQL code block.

    2.A cursor is named so that it can be referenced.

  • Declaring a cursor defines the name of the cursor and associates it with a SELECT statement.

  • The first step is to Declare the Cursor with the following syntax:

  •   CURSOR c_cursor_name IS select statement

    • Cursor names follow the same rules of scope and visibility that apply to the PL/SQL identifiers.
    • Because the name of the cursor is a PL/SQL identifier, it must be declared before it is referenced.
    • Any valid select statement can be used to define a cursor, including joins and statements with the UNION or MINUS clause.
0 Dislike
Follow 1

Please Enter a comment

Submit

Other Lessons for You

How to read and understand the Compilation errors?
Today, we will understand how to interpret the compile time erros and fix them. Don't confuse with runtime errors which is altogether a different subject called Exception Handling. Compilation erros are...

Oracle Architecture - Introduction
As a Oracle developer or a DBA, you should know the in & out of it’s Architecture. Let’s keep it simple first and explore later. Oracle is a software or a program, so like any other program,...

Interview questions on Packages in Oracle
Let me list few standard questions asked in the interviews on plsql package. 1. Why packages are used? What are it's advantages? 2. Name few bulin-in Oracle packages. 3. Can we have a function or procedure...

New features of Oracle 23ai
2 of the new features of Oracle 23ai (previously Oracle 23c) with respect to SQL are discussed. 1. Boolean datatype included in SQL. Previously, boolean was not part of SQL, but belonged to Oracle...

Some Interesting and important built in packages in Oracle
DBMS_JOB : To schedule jobs. DBMS_SCHEDULER: Extended the functionalities of DBMS_JOB. UTL_SMTP: To send mails. UTL_HTTP: To open Web APIs (URLs). DBMS_LOB: Very interesting and useful. Programmatic...

Looking for PL/SQL Classes?

Learn from Best Tutors on UrbanPro.

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for PL/SQL Classes?

The best tutors for PL/SQL Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn PL/SQL with the Best Tutors

The best Tutors for PL/SQL Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more