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

differentiate between float and double. : Sql dba

0 Answers  


what is difference between procedure and function, procedure and trigger?

8 Answers   iFlex,


what is constraining table?

2 Answers  


What are the disadvantages of file system?

0 Answers  


What is sql clause?

0 Answers  






describe transaction-safe table types in mysql : sql dba

0 Answers  


how to find the second highest salary from emp table?

211 Answers   CIS, Cognizant, Cosmosoft, DAS, EDS, GreenTech, HOV Services, IBM, Infosys, National Institute of Science and Technology, Patni, Persistent, Polaris, TCS, Wipro, Yardi, Zensar,


Is left join inner or outer?

0 Answers  


What is a dynamic query?

0 Answers  


What is the difference between union and union all command?

0 Answers  


Hi, Can anybody please explain me the flow of the below query. I am not able to understand how this query works. This query is for finding the Nth highest salary.. SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal); If N = 2 then second highest salary will be the o/p. If N = 3 then third highest salary will be the o/p. and so on.. Thanks, Nitin

5 Answers   Deloitte, Ness Technologies,


What is substitution variable in pl sql?

0 Answers  


Categories