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

8 Answers  


What are instead of triggers?

0 Answers  


In what condition is it good to disable a trigger?

0 Answers  


What is the differnce between view and materialized view

4 Answers   TCS,


Describe different types of general function used in sql?

0 Answers  






when is the use of update_statistics command? : Sql dba

0 Answers  


What are string functions in sql?

0 Answers  


How write primary and foreign key relationship between two tables without using constraints? u can use any of procedure/function/trigger and any sql?

1 Answers   Parexel,


Explain architecture of sql server notification services?

0 Answers  


Give which cursor is better for better performance means type of cursors?

2 Answers  


How to connect a sql*plus session to an oracle server?

0 Answers  


What is parallel hint?

0 Answers  


Categories