title: Oracle schema user cannot create table in procedure
body: <p>I'm trying to create a temporary table in a procedure:</p>
  
  <pre><code>PROCEDURE pr_create_tmp_bp_table(fp_id NUMBER) IS
      tbl_name CONSTANT VARCHAR2(20) := 'BP_TO_DELETE';
  BEGIN
      -- sanity checks removed for readablity
  
      EXECUTE IMMEDIATE 
          'CREATE GLOBAL TEMPORARY TABLE ' || tbl_name || ' ' ||
          'ON COMMIT PRESERVE ROWS AS ' ||
          'SELECT * FROM infop_stammdaten.bp';
  
  END;
  </code></pre>
  
  <p>If I copy the <code>BEGIN.._END</code> block to a SQL worksheet everything works fine. So I think the user has the right to create a temporary table. If I execute the procedure from the same SQL worksheet I get</p>
  
  <pre><code>Fehlerbericht -
  ORA-01031: Nicht ausreichende Berechtigungen
  ORA-06512: in "INFOP_STAMMDATEN.PA_DELETE_FP", Zeile 16
  ORA-06512: in Zeile 6
  01031. 00000 -  "insufficient privileges"
  *Cause:    An attempt was made to perform a database operation without
             the necessary privileges.
  *Action:   Ask your database administrator or designated security
             administrator to grant you the necessary privileges
  </code></pre>
  
  <p>Line 16 (Zeile 16) point to the EXECUTE IMMEDIATE statment that creates the temporary table.</p>
  
  <p>To me this look like the user does not have the same rights in the sql work sheet and when it executes a procedure, also the procedure is in it's own schema.</p>