difference between cursor and procedure in a package

Answer Posted / vaibhavi_dixit

Whenever a statement is send by user to Oracle server for
execution, a memory is allocated in which the statement is
executed,records are fetched and send back to user.Once
records are sent the memory is deallocated.This memory area
is know as implicit cursors and the selected records are
known as "Active set".Implicit cursors are handled by
Oracle and user does not have control on it.But in case user
(programmer) needs to have control then one can declare
explicit cursors.In Explicit cursors, cursor is
declared,when it is opened, the stament is executed, and
the data is fetched in memory.The records will remain in
memory, till programmer does not close the cursor.The
advantage of this is ,one can select 'n' no of records and
fetch one by one.Also one can pass parameters to cursors
for getting new set of records.
Procedure is nothing but named PL/SQL block which can be
individually executed or can be called from other procedure
or function.It is stored as an object in database schema.
One can acheive polymorphism in procedures if they are a
part of package.
Cheers
vd

Is This Answer Correct ?    24 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use transactions efficiently : transact sql

768


what is a scheduled jobs or what is a scheduled tasks? : Sql dba

733


How do you remove duplicate records from a table?

675


What is the use of pl/sql table?

756


Is primary key is clustered index?

724






What is the difference between the conventional and direct path loader? : aql loader

864


How are sql commands classified?

801


Can procedure in package be overloaded?

837


What are dml commands?

736


What is pl sql commands?

730


What is lexical units in pl sql?

761


What is meant by cursor in sql?

725


What does the argument [or replace] do?

807


If the application is running very slow? At what points you need to go about the database in order to improve the performance?

752


What is pl sql and why it is used for?

799