存储过程中可以使用CREATE语句吗?

flowerinwind 2003-10-17 03:38:35
请帮我看下这段代码:
create or replace procedure create_tablex
as
begin
create table x (col number)
end;
编译出现错误,求教!
...全文
77 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
beckhambobo 2003-10-18
  • 打赏
  • 举报
回复
create or replace procedure create_tablex
as
str varchar2(50);
begin
str:='create table x (col number)';
execute immediate str; --grant create any table to 水发
end;
selinash 2003-10-18
  • 打赏
  • 举报
回复
在PL/SQL中使用动态SQL,执行execute Immediate
sunzuzu 2003-10-18
  • 打赏
  • 举报
回复
用动态SQL可以的,在9i中很简单,较早版本的动态SQL很麻烦
shine333 2003-10-18
  • 打赏
  • 举报
回复
create or replace procedure create_tablex
as
begin
execute immediate 'create table x (col number)';
end;
chanet 2003-10-17
  • 打赏
  • 举报
回复
有权限就可以.
chineseyounger 2003-10-17
  • 打赏
  • 举报
回复
当然可以用!
xu_guanghui 2003-10-17
  • 打赏
  • 举报
回复
用动态SQL
JCC0128 2003-10-17
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/2076/2076788.xml?temp=.3047449

给分

17,086

社区成员

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

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