ORAEX 5 - Returning rows from a PL/SQL Function

Philip Greenspun's Homepage : Philip Greenspun's Homepage Discussion Forums : 6916 : One Thread
Notify me of new responses
Does anyone know how we are supposed to return all the totals in the
3rd part of ORA-exercise 5? I got the cursor working, but not sure how
to produce an output from the function equivalent to a select. Also ,
when I load a PL/SQL function using '@filename' method, it sometimes
tells me that there were compile errors, but never gives them. How can
I see them?

-- Gary Mishuris, September 17, 1999


Return values from a PL/SQL function

In exercise 5, you are writing a PL/SQL function that returns a value. Look for the PL/SQL User's Guide and Reference in the Online Oracle Documentation page. The section on Cursor For Loops has a nice explanation and some good examples. Also, the RETURN Statement might be useful.

Also, you can see your compilation errors with the command:
show errors
on the next line after the "/" that terminates the PL/SQL block in SQLplus.

-- Jesse Koontz, September 17, 1999