ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle存储过程procedure_输入参数varchar2与char报错

oracle存储过程procedure_输入参数varchar2与char报错

原创 Linux操作系统 作者:wisdomone1 时间:2012-12-14 10:22:23 0 删除 编辑
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;
 
小结:1,如果存储过程输入参数是char或varchar2,如在存储过程使用,就会报错
         2,换成其它类型如:date,timestamp,int,pls_integer,则一切正常
        3,这是什么原因

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-751089/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12685324