|
|
FULL A - Z Oracle Function Library (formerly named "Morgan's Library")
Term: RETURN
Definition: CREATE OR REPLACE FUNCTION [FUNCTION NAME] Example Usage: The function "F_RET_VAL" is created which returns a NUMBER value, i.e. 1 from the function body. CREATE OR REPLACE FUNCTION F_RET_VAL 2. As a PL/SQL Statement In PL/SQL code the RETURN keyword can appear in any subprogram as a statement. As soon as it is encountered in the subprogram body, Oracle server immediately sends the execution control back to the immediate calling code or host environment. No further statements are processed in the block following the RETURN statement. Note that a function can contain RETURN both as a clause and a statement. Example Syntax: CREATE OR REPLACE [SUBPROGRAM] [NAME] In the above syntax, when the execution pointer comes to the RETURN statement, Oracle skips all subsequent statements and returns to the calling environment. Example Usage: In the example below, a procedure named "P_RET_VAL" is created which returns the control to the calling environment based on the value of P_EMPNO. It returns if it is NULL. CREATE OR REPLACE PROCEDURE P_RET_VAL (P_EMPNO NUMBER DEFAULT NULL) Related Links:
Related Code Snippets:
|
Home | Search | Code Library | Sponsors | Privacy | Terms of Use | Contact Us | © 2003 - 2024 psoug.org |