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

What is sql key?

508


What is the difference between an inner and outer join?

531


What is the use of index in hive?

544


What is the difference between in and between in sql?

571


Can we perform dml on view?

548






Is left join faster than join?

534


What are the parts of a basic sql query?

505


List the ways to get the count of records in a table?

503


How to connect a sql*plus session to an oracle server?

615


what is the difference between primary key and unique key? : Sql dba

518


What is the difference between local and global temporary table?

542


What is scalar data type in pl sql?

546


What is sql mysql pl sql oracle?

561


How long does it take to learn pl sql?

601


What are the different ways to optimize a sql query?

482