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 |
How to write a query to show the details of a student from students table whose
How do I trace sql profiler?
What is left inner join in sql?
What are the two types of exceptions.
What is sql server and ase?
What is primary key secondary key alternate key candidate key?
Can we join 3 tables in sql?
what does it mean to have quoted_identifier on? : Sql dba
what is the bond code in materialized view?
How do I find duplicates in a single column in sql?
How to display Row Number with Records in Oracle SQL Plus?
What is difference between CHAR and VARCHAR2?What is the maximum SIZE allowed for each type?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)