create or replace procedure proc_bulk_table(x char(1))
as
v_number pls_integer;
v_cnt pls_integer;
v_begin pls_integer;
v_receive char(1);
begin
v_receive:=x;
v_number:=3;
for i in 1..v_number loop
v_begin:=i-1;
select count(t.tname) into v_cnt from tab t where tname='T_BULK_TABLE'; --;||to_char(to_date(in_start_date,'yyyymmdd')+v_begin,'yyyymmdd');
if v_cnt=0 then
execute immediate 'create table t_bulk_table'||to_char(i)||'(a int,b int)';
execute immediate 'create index idx_t_bulk_table_'||to_char(i)||' on t_bulk_table'||to_char(i)||'(a)';
end if;
end loop;
end;
v_number pls_integer;
v_cnt pls_integer;
v_begin pls_integer;
v_receive char(1);
begin
v_receive:=x;
v_number:=3;
for i in 1..v_number loop
v_begin:=i-1;
select count(t.tname) into v_cnt from tab t where tname='T_BULK_TABLE'; --;||to_char(to_date(in_start_date,'yyyymmdd')+v_begin,'yyyymmdd');
if v_cnt=0 then
execute immediate 'create table t_bulk_table'||to_char(i)||'(a int,b int)';
execute immediate 'create index idx_t_bulk_table_'||to_char(i)||' on t_bulk_table'||to_char(i)||'(a)';
end if;
end loop;
end;
小结:1,如果存储过程输入参数是char或varchar2,如在存储过程使用,就会报错
2,换成其它类型如:date,timestamp,int,pls_integer,则一切正常
3,这是什么原因
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-751089/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9240380/viewspace-751089/