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 the difference between numeric and autonumber?
What is primary key and foreign key?
How to add new employee details in an employee_details table with the following details
What is the difference between python and sql?
What are database links used for?
What is a join?
What are all different types of collation sensitivity?
How you improve the performance of sql*loader? : aql loader
Explain architecture of sql server notification services?
What is pragma in sql?
how can you create an empty table from an existing table? : Sql dba
Which is better join or inner query?
What is difference between pls_integer and integer?
How do you identify a primary key?
Is sql the best database?