Statements after Return will not be executed : Function Return « Function Procedure Packages « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE OR REPLACE FUNCTION myProc RETURN VARCHAR2
  2  AS
  3  BEGIN
  4     RETURN NULL;
  5     DBMS_OUTPUT.put_line ('Never here...');
  6  END myProc;
  7  /


SQL>
SQL> SHOW ERRORS PROCEDURE myProc
Errors for PROCEDURE myProc:

LINE/COL ERROR
-------- -----------------------------------------------------------------
5/4      PLW-06002: Unreachable code
6/7      PLW-06002: Unreachable code
8/7      PLW-06002: Unreachable code
14/4     PLW-06002: Unreachable code
SQL>
SQL> DROP PROCEDURE myProc;

Procedure dropped.








27.3.Function Return
27.3.1.Return Types
27.3.2.Returning values with functions
27.3.3.Return number from a function
27.3.4.Return value from a function
27.3.5.Multiple RETURN Statements
27.3.6.Returning a list based on parameters
27.3.7.Return date value from a function
27.3.8.A pipelined Table Function that returns a PL/SQL type
27.3.9.Return column type
27.3.10.Statements after Return will not be executed
27.3.11.create a function to return a employee record. accept employee numner return all fields.
27.3.12.Return a table collection
27.3.13.Demonstrate returning a record.
27.3.14.Return cursor from function
27.3.15.Return user-defined type