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
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 |
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 |
differentiate between float and double. : Sql dba
what is difference between procedure and function, procedure and trigger?
what is constraining table?
What are the disadvantages of file system?
What is sql clause?
describe transaction-safe table types in mysql : sql dba
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?
What is a dynamic query?
What is the difference between union and union all command?
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?