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 |
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 will you get by the cursor attribute sql%notfound?
What is the benefit of foreign key?
What is clustered index in sql?
What are the query optimization techniques?
What is sql partition function?
How do I run a sql trace?
What are the differences between Database Trigger and Integrity constraints ?
Is vs as in pl sql?
How to select unique records from a table?
what is purge command explain about oracle performance tuning
2 Answers Accenture, eCentric Solutions,
how to select alphabets in a one column , for this the table name is PA_TASKS and column name is TASK_NUMBER, In TASK_NUMBER the data like this 1.1.3NN,1.1.4NN,1.5.1NN,1.3.2NE,1.5NN,1NN,1.2NE,1CE , For this i need to disply output as NN,NN,NN,NE,NN,NN,NE,CE, Its some urgent requirement ,thanks in advance