What is difference between a Cursor declared in a procedure
and Cursor declared in a package specification ?

Answers were Sorted based on User's Feedback



What is difference between a Cursor declared in a procedure and Cursor declared in a package specif..

Answer / tulsi

A cursor declared in a package specification is global and
can be accessed by other procedures or procedures in a
package.
A cursor declared in a procedure is local to the procedure
that can not be accessed by other procedures.

Is This Answer Correct ?    40 Yes 2 No

What is difference between a Cursor declared in a procedure and Cursor declared in a package specif..

Answer / ratan singh sengar

SP is a set of SQL Statements that resides in server. Advantage of SP is just that it is pre compiled and available in the server. So, whenever this SP is called, its executed instantly since its already been compiled. This makes the faster performance while executing the SP.
cursor:
Cursors are add on feature of SP , for row by row validations.
For instance : You have a list of employees belong to various department. For calculating the bonus % which varies for department to department, you use cursors to calculate Bonus.

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More SQL PLSQL Interview Questions

What is cursor explain with example?

0 Answers  


What is difference between stored procedures and application procedures?

0 Answers  


How do I run a pl sql procedure in sql developer?

0 Answers  


What is left join in sql?

0 Answers  


What is primary key and foreign key?

0 Answers  






How to return more than one value from a function?

11 Answers   Satyam,


counting the no.of characters occurs in a string by using pl/sql function

1 Answers   TCS,


Table name: T1, it has only one column. col1 ------ c b a b b b b d s a a t s Requirement: I need the following output from the above base table by using SQL query. col1 Cnt ----- ------- a 3 b 5 Others 5 Please help. Thanks Guru v.gurus@in.com

11 Answers  


How do you write a subquery?

0 Answers  


Give the structure of the function ?

2 Answers  


Can a trigger call a stored procedure?

0 Answers  


Create table emp (id number(9), name varchar2(20),salary number(9,2)); The table has 100 records after table created.Now i nee to change id's Datatype is to be Varchar2(15). now Alter table emp modify(id varchar2(15),name varchar2(20), salary number(9,2)); Whether it will work or returns error? post answer with explanation.

13 Answers   Oracle, TCS,


Categories