Summary About Oracle PL/SQL (Part 2)

  • A function must return value.
  • A procedure mainly used to an action. It allowed to not return value.
  • Basic syntax to create procedure
    CREATE [OR REPLACE] PROCEDURE procedurename
    [(parametername [in|out|in out] type, [...])]
    [IS|AS]
    BEGIN
       <procedure body>
    END;
    

    Note:
    [xxx] => optional
    OR REPLACE => used to modify existing procedure.
    IN => value from outside
    OUT => return value
    IN OUT => return value and the value from outside allocated on same parameter
    AS => used for standalone procedure

  • Basic syntax to create function
    CREATE [OR REPLACE] FUNCTION functionname
    [(parametername [in|out|in out] type, [...])]
    RETURN returndatatype
    [IS|AS]
    BEGIN
       <function body>
    END [functionname];
    
  • To execute standalone procedure Continue reading “Summary About Oracle PL/SQL (Part 2)”
Advertisement