When writing a stored procedure, the specific usage of return

Return in PL/SQL is similar to Return in Java and has two functions

              Return

  1. as a clause.Function must have a return value. The usage is as follows

    1. CREATE OR REPLACE FUNCTION [FUNCTION NAME]
    2. RETURN [RETURN TYPE] IS
    3. BEGIN
    4. RETURN returnValue;
    5. END;
  2. as a PL/SQL statement. When a procedure calls another procedure, there are multiple begin ... endstatement blocks in the other procedure and only the statement block that satisfies the condition is executed and returned to the calling site, a false Return is required in the called storage in the process.

    1. CREATE OR REPLACE [SUBPROGRAM][NAME]
    2. IS
    3. BEGIN
    4. statement 1;
    5. ...
    6. RETURN;
    7. statement 2;
    8. END;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326402186&siteId=291194637