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

Introduction to Performance tuning
What is Performance in general terms? Throughput per Input. For Eg: we keep saying, this bike has so and so much of mileage and all that. That is one of the parameters in measuring the performance of...

Exception Handling topics
Here, I am only going to list the topics which one should consider to master Exception Handling. 1. Types of errors in Pl/sql- Compile time and Run time 2. How to read and understand the Compile time...

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...

Starter on exception handling
Just run these two blocks individually, observe the output and comment on what do you understand from it. SET SERVEROUTPUT ONDeclareCursor C is select * from emp;i c%rowtype;BeginFetch C into i;End; SET...

How does a SQL Query Execute inside Oracle? What are the steps followed in the background?
The above snapshot says it all. Hence it is said, 'Picture says it all'. Basically, there are 4-5 steps. There are two possible ways of query being executed. 1. Soft Parse- Improves performance....

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