执行CREATE GLOBAL TEMPORARY

shdcsdn 2006-02-14 11:08:22
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)会报错
如何执行才是对的?
谢谢!
...全文
103 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cenlmmx 2006-02-14
  • 打赏
  • 举报
回复
google
shdcsdn 2006-02-14
  • 打赏
  • 举报
回复
dbms_sql包如何用?
谢谢?
boydgmx 2006-02-14
  • 打赏
  • 举报
回复
plsql中不允许DDL语句直接出现,就用 execute immediate 吧
shdcsdn 2006-02-14
  • 打赏
  • 举报
回复
用execute immediate也不好用
求助!
shdcsdn 2006-02-14
  • 打赏
  • 举报
回复
不想用execute immediate
shdcsdn 2006-02-14
  • 打赏
  • 举报
回复
Compilation errors for PROCEDURE CT00.HELLO

Error: 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>
cenlmmx 2006-02-14
  • 打赏
  • 举报
回复
execute immediate ' CREATE GLOBAL TEMPORARY table aaab as (select * from emp)'或者用dbms_sql包

17,082

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧