How to display the contents of a current record fetched in
a reference cursor?
Answer Posted / karthik
U define a variable in the SQL Prompt as ref cursor Before
that u have to write a procedure with a sys ref cursor as a
inout parameter.Then execute the procedure by passing the
variable defined in the SQL prompt and print the variable It
will display the records.
declare
cursor v_cursor is
select empno empnm empdept from emp where empdept 10;
begin
open v_cursor;
loop
fetch v_cursor into c_empno c_empnm c_empdept;
exit when v_cursor notfound;
dbms_output.put_line(c_empno || ' | ' || c_empnm || ' | ' ||
c_empdept );
end loop;
close v_cursor;
end;
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What is rank dense_rank and partition in sql?
how many values can the set function of mysql take? : Sql dba
Why is partition used in sql?
What is write ahead logging in sql server?
What operators deal with null?
How can you load multi line records? : aql loader
1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins
How to call a javascript function from pl sql?
What are system versioned tables?
Can a foreign key be null?
differentiate between float and double. : Sql dba
which operator is used in query for pattern matching? : Sql dba
Can we have two clustered index on a table?
How many types of literals are available in pl sql?
What is the difference between microsoft access and sql?