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 |
What is ROWID?
What are instead of triggers?
In what condition is it good to disable a trigger?
What is the differnce between view and materialized view
Describe different types of general function used in sql?
when is the use of update_statistics command? : Sql dba
What are string functions in sql?
How write primary and foreign key relationship between two tables without using constraints? u can use any of procedure/function/trigger and any sql?
Explain architecture of sql server notification services?
Give which cursor is better for better performance means type of cursors?
How to connect a sql*plus session to an oracle server?
What is parallel hint?