Search code examples
oracle-databaseplsql-package

What is the difference between a "procedure name IS' and a "Procedure name AS" in Oracle?


PROCEDURE sample (p_num1 IN TABLE%TYPE, p_num2 OUT NUMBER) IS

OR

PROCEDURE sample (p_num1 IN TABLE%TYPE, p_num2 OUT NUMBER) AS


Solution

  • The difference is only one letter: I vs. A. You can use both, there won't be any other difference. The effect of executing both is the same except for the same minor difference stored in the data dictionary tables [CDB|DBA|ALL|USER]_SOURCE.

    SQL> create or replace procedure p_test is begin null; end;
      2  /
    
    Procedure created.
    
        SQL> create or replace procedure p_test as begin null; end;
          2  /
    
        Procedure created.
    
        SQL>
    

    Note that it doesn't work for e.g. views:

    SQL> create or replace view v_emp as select * from emp;
    
    View created.
    
    SQL> create or replace view v_emp is select * from emp;
    create or replace view v_emp is select * from emp
                                 *
    ERROR at line 1:
    ORA-00905: missing keyword