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 a delimiter in sas?
Explain scalar functions in sql?
what is sql? : Sql dba
How to select unique records from a table?
What is pl sql variable?
what is data manipulation language? : Sql dba
Show the two pl/sql cursor exceptions.
What can sql server reporting services do?
What are the different types of tables in sql?
what is sql in mysql? : Sql dba
What is pl sql quora?
What is dml and ddl?
what is union? : Sql dba
what is the difference between nested subquery and correlated subquery?
Why having clause is used in sql?