How to display the contents of a current record fetched in
a reference cursor?

Answers were Sorted based on User's Feedback



How to display the contents of a current record fetched in a reference cursor?..

Answer / sandeep t

%sqlcount

Is This Answer Correct ?    0 Yes 1 No

How to display the contents of a current record fetched in a reference cursor?..

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

Post New Answer

More SQL PLSQL Interview Questions

What is type and rowtype in pl sql?

0 Answers  


What packages(if any) has oracle provided for use by developers?

1 Answers  


suppose I have two table one Emp and other is dpt. Emp table has a field ,dept id,name ,sal and dpt table has a field dept id,dept name. Now I want to find out the emplyee list whose sal is between 2000-3000 from dept x.

7 Answers   Geometric Software, IBM,


What is the starting oracle error number? What is meant by forward declaration in functions?

0 Answers  


what are the advantages of using stored procedures? : Sql dba

0 Answers  






Determine if oracle date is on a weekend?

0 Answers  


What is a stored procedure in sql with example?

0 Answers  


What is difference between stored function and application function?

0 Answers  


Explain polymorphism in pl/sql.

0 Answers  


What are the possible values that can be stored in a boolean data field?

0 Answers  


how to analyze tables with 'mysqlcheck'? : Sql dba

0 Answers  


What is a trigger in pl/sql?

1 Answers  


Categories