create or replace procedure hello(w_gg out number) is   W_DENPYONO NUMBER(10);
  
begin   W_DENPYONO :=10;
   CREATE GLOBAL TEMPORARY table aaab as (select * from emp)end hello;在存储过程中执行CREATE GLOBAL TEMPORARY table aaa as (select * from emp)会报错
如何执行才是对的?
谢谢!

解决方案 »

  1.   

    execute immediate ' CREATE GLOBAL TEMPORARY table aaab as (select * from emp)'或者用dbms_sql包
      

  2.   

    Compilation errors for PROCEDURE CT00.HELLOError: PLS-00103: Encountered the symbol "CREATE" when expecting one of the following:
           
              begin case declare end exception exit for goto if loop mod
              null pragma raise return select update while with
              <an identifier> <a double-quoted delimited-identifier>
              <a bind variable> << close current delete fetch lock insert
              open rollback savepoint set sql execute commit forall merge
              <a single-quoted SQL string> pipe
              <an alternatively-quoted SQL string>
      

  3.   

    用execute immediate也不好用
    求助!
      

  4.   

    plsql中不允许DDL语句直接出现,就用 execute immediate 吧