title: Check Package exist or not before create it in Oracle
body: <p>Need help</p>
  
  <p>How do I check for a package if it exists or not and skip the creation if it already exists.</p>
  
  <p>I have done the following and I got an error</p>
  
  <pre><code>DECLARE
      l_cnt INTEGER;
      own   VARCHAR(200);
  BEGIN
      SELECT sys_context( 'userenv', 'current_schema' ) INTO own FROM dual;
      SELECT count(*)
      INTO l_cnt
      FROM ALL_OBJECTS
      WHERE object_type = 'PACKAGE' 
      and object_name = 'JUSTICE_LEAGUE'
        AND OWNER        = own;
      IF( l_cnt       &lt;= 0) THEN
  
  EXECUTE IMMEDIATE 
  'create or replace PACKAGE "JUSTICE_LEAGUE" AS
  
  FUNCTION BATMAN(argPSN INT)
  RETURN INT;
  
  FUNCTION SUPERMAN(argSN int)
  RETURN Info.infovalue%Type;
  
  PROCEDURE AQUAMAN(argASN INT,argAssignedUser folderProcess.assignedUser%Type DEFAULT 'None');
  
  END JUSTICE_LEAGUE';
  
  DBMS_OUTPUT.PUT_LINE('Package created successfully');
      ELSE
  DBMS_OUTPUT.PUT_LINE('Package exists already');
  
  END IF;
  END;
  /
  
  Error report -
  ORA-06550: line 23, column 70:
  PLS-00103: Encountered the symbol "ALL" when expecting one of the following:
  </code></pre>
  
  <p>Is it a right way to put the create command for package within EXECUTE IMMEDIATE ?</p>