Explain the two type of Cursors ?
Answers were Sorted based on User's Feedback
Answer / joseph p v
2 Types
-Implicit Cursor
-Explicit Cursor
-Implicit Cursor
All select queries are examples of implicit cursor. While
submitting a select query , Oracle internally handle the
Open, fetch and close operations. Implicit Cursors are
using while query returns only row.
-Explicit Cursor
We want to explicitly define one cursor, open the cursor,
fetch and close the same. These type cursors are using
while the query return more than one row.
Ref Cursors are Cursors having the dynamic cursor statement
capabilities.
| Is This Answer Correct ? | 17 Yes | 0 No |
Answer / tulsi
There are two types of cursors, Implict Cursor and Explicit
Cursor.
PL/SQL uses Implict Cursors for queries.
User defined cursors are called Explicit Cursors. They can
be declared and used.
| Is This Answer Correct ? | 15 Yes | 2 No |
Answer / gireesh.p.v
Implict Cursor and Explicit
Cursor.
& also REF CURSORS
| Is This Answer Correct ? | 8 Yes | 2 No |
Answer / sachin fulari
Brief about Cursors
-------------------
Every SQL statement executed by Oracle has a Private SQL
area that contains info about SQL statement and the set of
data returned.
In PL/SQL, a cursor is a name assigned to a specific
private SQL area of a specific SQL Statement.
There can be either, Static Cursor whose SQL statements is
determined at compile time, or Dynamic Cursor, whose SQL
statement is determined at runtime.
Note: Dynamic Cursors are implemented using Oracle built in
package DBMS_SQL.
Implicit Cursors:
----------------
Any SQL statement that is executed directly or in an PL/SQL
block i.e. execution section or in exception section,
during which it is associated with a work area in memory of
oracle (SGA). This is done using implicit cursor by Oracle.
We do not need to declare implicit cursor hence not be
opened, fetched and closed.
Explicit Cursors:
-----------------
They are the SELECT statement that is declared explicitly
in the declaration section of current block or in a package
specification.
Further we can use open, fetch and close in execution
section or exception section of the block or program to
utilize declared cursor.
To use an explicit cursor we need to declare it in
declaration section of block or package specification.
There are three sub types of explicit cursors:
* Simple Cursor (without parameter)
CURSOR emp_cur IS
SELECT emp_id
FROM emp;
* Parameterized Cursor - That accepts arguments
CURSOR emp_cur (dept_in [IN] NUMBER) IS
SELECT emp_id
FROM emp
WHERE dept = dept_in ;
* Returning Cursor - A cursor header that contains
a return clause
CURSOR emp_cur (dept_in [IN] NUMBER) IS
RETURN emp%ROWTYPE
SELECT *
FROM emp;
Hope so, above paragraphs explain cursors very well and in
details.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / k minty
actually there are three types of cursors
1. static cursors which are further classified as implicit
cursors and explicit cursors
2. Dynamic Cursors
3. Reference Cursors.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sachin fulari
To add upon
-----------
REF CURSOR is data type in Oracle, and to mention it as
dynamic cursor is totally erroneous.
We can declare variables of type REF CURSOR in declartion
section and which later on can associate with different
queries in execution section.
Moreover, we can also pass query as argument to procedures
using such data type.
( To easily understand REF CURSOR data type:
Visualize as if we are declaring a scalar data type like
NUMBER or CHAR and then utilizing it in execution
section.)
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / james bond
<html>
<body>
<h1>Please give detail info</h1>
<p>on cursors.</p>
</body>
</html>
| Is This Answer Correct ? | 1 Yes | 5 No |
Hi how to import oracle sequence in Informatica? Please write stored procedure code that will import oracle sequence in Informatica SP transformation as per below scenario Oracle table product list Pro_id, pro_name 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights Now a new flat file with new product list needs to be added to oracle table product list with oracle sequence. flat file product Prono,pro_name, 1, 20 watt tube light 2, 30 watt tube light & target should be like 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights. 104, 20 watt tube light 105, 30 watt tube light thks reg suvarna joshi suvarnaatsuvarna@rediffmail.com
Is there a 64 bit version of ssms?
How to use boolean type in select statement?
What is difference between nchar and nvarchar?
What is rank () in sql?
How are functions and procedures called in PL/SQL?
I i have 2 tables A & B ,A contains 10 records B contains 20 records ,what w'll be the o/p if we perform equijoin,outer join,right outer join,left outer join,full outer join,cross join seperately Can anyone help on this?
What is sql lookup?
What is a record in pl/sql?
what are the advantages a stored procedure? : Sql dba
i hv 30 rows with date.ex:1month hav 4 weeks i want 1st day of the every week.write the qry for that.example jan has 4 weeks i need 1st dd for evry wk
What is pragma in pl sql?
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)