How to display the contents of a current record fetched in
a reference cursor?
Answers were Sorted based on User's Feedback
Answer / 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 |
suppose u hav 1 book with set...page 1-100 n 101 -200 now print page from 2-100 n 102 -200... how we will do..?
what is the difference between blob and text? : Sql dba
how to calculate the difference between two dates? : Sql dba
Is keyword pl sql?
What is data manipulation language?
How do you remove duplicates without using distinct in sql?
Is sql open source?
What is a Procedure ?
What is trigger and how to use it in sql?
explain primary keys and auto increment fields in mysql : sql dba
what is subquery? : Sql dba
Why is normalization important?