RT 编辑,测试都没有问题, 执行 EXEC chuangjiang(1) 提示过程执行成功,但是没有找到新表A1create or replace procedure chuangjian
(v_id in varchar)
is
beginif v_id = to_char(1,9)thenexecute immediate 'create table A1 as select * from a'|| ';';
end if ;
end;
(v_id in varchar)
is
beginif v_id = to_char(1,9)thenexecute immediate 'create table A1 as select * from a'|| ';';
end if ;
end;
(v_id in varchar)
is
beginif v_id = trim(to_char(1,9))thenexecute immediate 'create table A1 as select * from dual';end if ;
end;
(v_id in varchar)
is
beginif v_id = to_char(1,9) --------这里不成立,所以直接跳过去了thenexecute immediate 'create table A1 as select * from a'|| ';'; -----这个最后面也有问题,
end if ;
end;
2.后面改为 :execute immediate 'create table A1 as select * from a ;';
这样对么? 执行的时候没报错
(v_id in varchar)
is
begin
if v_id = 1
then
execute immediate 'create table A1 as select * from a';
end if ;
end;多谢指点,结贴散分