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

diff b/w sub query and co-relater query?

3 Answers   iFlex,


Can u create a primary key with out unique index.

8 Answers  


7. Where would you look for errors from the database design?

1 Answers   Fintellix,


What is a relationship and what are they?

0 Answers  


What is the difference between row level and statement level trigger?

0 Answers  






How to convert comma separated string to array in pl/sql?

0 Answers  


What is rename command in sql?

0 Answers  


Is a view faster than a stored procedure?

0 Answers  


Does a user_objects view have an entry for a trigger?

0 Answers  


Does truncate table reset auto increment?

0 Answers  


What is the difference between function and procedure in pl/sql?

0 Answers  


What is the difference between stored procedure and view?

0 Answers  


Categories