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

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..?

6 Answers  


what is the difference between blob and text? : Sql dba

0 Answers  


how to calculate the difference between two dates? : Sql dba

0 Answers  


Is keyword pl sql?

0 Answers  


What is data manipulation language?

0 Answers  






How do you remove duplicates without using distinct in sql?

0 Answers  


Is sql open source?

0 Answers  


What is a Procedure ?

3 Answers  


What is trigger and how to use it in sql?

0 Answers  


explain primary keys and auto increment fields in mysql : sql dba

0 Answers  


what is subquery? : Sql dba

0 Answers  


Why is normalization important?

0 Answers  


Categories