how a reference cursor works?what all adnvantages are
gained with it..specify the situation?
Answers were Sorted based on User's Feedback
Answer / swapnareddy
Basically, Reference cursor is datatype.Reference cursor works
as a cursor variable.the advantage of using reference cursor
is it pass the result sets to the subprograms
(ie,procedures,packages and functions etc).
example for reference cursor usage:
type r_cursor is ref cursor;
c_emp r_cursor;
ename1 emp.ename%type;
begin
open c_emp is select ename from emp;
loop
fetch c_emp into ename1;
exit when c_emp% notfound;
dbms_output.put_line(ename1);
end loop;
close c_emp;
end;
| Is This Answer Correct ? | 6 Yes | 1 No |
Generally, through static cursors we are using only one select statement at a time for single active set area. Whereas, in ref cursor we are executing number of select statements dynamically for single active set area. That’s why these types of cursors are called dynamic cursors.
1) Strong Ref Cursor: Having return type.
2) Weak Ref Cursor: Does not have return type.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / rahul
1) It's a datatype.
2) variable created based on this is called cursor variable
3) advantage is their capability to pass result sets between
programs
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / a.jyothsna
Difference between cursor and ref-cursors is same as the
difference between variable and constant.
With ref-cursors we can use the cursors variable.
| Is This Answer Correct ? | 1 Yes | 5 No |
Can we write create command in the plsql block?if possible how?
What are different types of sql?
How many parts of a pl sql block are optional?
Explain the difference between triggers and constraints?
What is left join in postgresql?
What's the procedure?
Explian rowid, rownum? What are the psoducolumns we have?
Is it possible to sort a column using a column alias?
What are dml commands?
what is the difference between varray and table data type..please expalain with some examples... under what situation you will go for varray..instead of index by table...
how i do the database testing of online money transactions between two parties (client and organization). suppose our company makes a website for our client and give a extra feature of online money transaction with there clients then how i test this feature in database testing
what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba
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)