Oracle PL-SQL Question:
Download Questions PDF

How to avoid using cursors? What to use instead of cursor and in what cases to do so?

Answer:

Just use subquery in for clause

ex:For emprec in (select * from emp)

loop

dbms_output.put_line(emprec.empno);

end loop;

no exit statement needed

implicit open,fetch,close occurs

Download Oracle PL-SQL Interview Questions And Answers PDF

Previous QuestionNext Question
How we can create a table in PL/SQL block. insert records into it? is it possible by some procedure or function? please give example?State the difference between implict and explict cursors?