title: oracle insufficient priviliges when creating view using a procedure
body: <p>When calling a procedure which should create a view, it returns "Insufficient Privileges". I can create the view using the SQL command itself, but not when running the procedure. All actions done are in the schema owner. Please let me know how to solve this issue.</p>
  
  <pre><code>/* 1. FIRST, I LOGON TO MY OWN SCHEMA, CALLED 'MY_SCHEMA' */
  /* (IF YOU WANT TO USE A DIFFERENT ONE, JUST REPLACE THE TEXT MY_SCHEMA WITH YOUR OWN SCHEMA NAME) */
  
  /* 2. DROP THE EXAMPLE TABLE IF IT ALREADY EXISTS */
  DECLARE TBL_COUNT INT;
  BEGIN
    SELECT COUNT(*) INTO TBL_COUNT FROM ALL_TABLES WHERE OWNER = 'MY_SCHEMA' AND TABLE_NAME = 'EXAMPLE';
    IF TBL_COUNT &gt; 0 THEN
      EXECUTE IMMEDIATE('DROP TABLE "MY_SCHEMA"."EXAMPLE"');
    END IF;
  END;
  /
  -- Result : Done
  
  /* 2. CREATE THE EXAMPLE TABLE */
  CREATE TABLE MY_SCHEMA.EXAMPLE
  (
    COL1 INTEGER
  );
  -- Result : Done 
  
  /* 3. THEN, CREATE A VIEW IN MY OWN SCHEMA, WHICH POINTS TO THE TABLE IN MY OWN SCHEMA */
  CREATE OR REPLACE VIEW MY_SCHEMA.VW_EXAMPLE AS SELECT * FROM MY_SCHEMA.EXAMPLE;
  -- Result : Done 
  
  /* 4. DROP THE VIEW, JUST FOR ARGUMENT'S SAKE */
  DROP VIEW MY_SCHEMA.VW_EXAMPLE;
  -- Result : Done 
  
  /* 5. NOW CREATE A PROCEDURE IN MY OWN SCHEMA, WHICH CREATES A VIEW IN MY OWN SCHEMA, WHICH POINTS TO A TABLE IN MY OWN SCHEMA */
  CREATE OR REPLACE PROCEDURE MY_SCHEMA.PRC_EXAMPLE AS
  BEGIN
    EXECUTE IMMEDIATE 'CREATE OR REPLACE VIEW MY_SCHEMA.VW_EXAMPLE AS SELECT * FROM MY_SCHEMA.EXAMPLE';
  END;
  -- Done
  
  /* 6. LET'S CALL THE PROCEDURE FROM MY OWN SCHEMA, WHICH SHOULD CREATE THE VIEW IN MY OWN SCHEMA, POINTING TO A TABLE IN MY OWN SCHMEA */
  BEGIN
    MY_SCHEMA.PRC_EXAMPLE;
  END;
  -- ORA-01031 : Insufficient privileges
  </code></pre>