Oracle SQL Question:

Explain What should be the return type for a cursor variable. Can we use a scalar data type as return type?

SQL Oracle Interview Question
SQL Oracle Interview Question

Answer:

The return type for a cursor must be a record type.It can be declared explicitly as a user-defined or %ROWTYPE can be used. eg TYPE t_studentsref IS REF CURSOR
RETURN students%ROWTYPE


Previous QuestionNext Question
How to find out nth highest salary from emp table?Select the Nth lowest value from a table?