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 |
What is cursor explain with example?
What is difference between stored procedures and application procedures?
How do I run a pl sql procedure in sql developer?
What is left join in sql?
What is primary key and foreign key?
How to return more than one value from a function?
counting the no.of characters occurs in a string by using pl/sql function
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
How do you write a subquery?
Give the structure of the function ?
Can a trigger call a stored procedure?
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.