当前位置: 代码迷 >> PB >> PB调用plsql存储过程。报错!pl sql数字或值异常字符串缓冲区太小
  详细解决方案

PB调用plsql存储过程。报错!pl sql数字或值异常字符串缓冲区太小

热度:36   发布时间:2016-04-29 06:39:49.0
PB调用plsql存储过程。报错!!pl sql数字或值错误字符串缓冲区太小
目前自己写的pb程序都碰到这种问题,varchar2类型的变量,我都设置成4000size了,还是没解决。代码如下:
PROCEDURE
 function check_actionata(p_actionata defect.actionata%type,
                           p_actype    orders.actype%type,
                           p_return    out varchar2) return number is
    l_count number;
  begin
    if trim(p_actionata) is null then
      p_return := null;
      return 1;
    end if;
    if trim(p_actype) is null then
      select count(ata)
        into l_count
        from ata
       where trim(ata) = trim(p_actionata)
         and not_for_defect is null;
    else
      select count(ata)
        into l_count
        from ata
       where trim(actype) = trim(p_actype)
         and trim(ata) = trim(p_actionata)
         and not_for_defect is null;
    end if;
    if l_count = 0 then
      p_return := zh_pub_function.get_message('DEFECT', -7);
      return 0;
    end if;
    p_return := null;
    return 1;
  end check_actionata;

调用函数:
if dwo.name = 'ata' then
data = trim(data)
ls_actype = trim(ls_actype)
ls_return = trim(ls_return)
sqlca.check_actionata( data, ls_actype, ls_return)
messagebox('提示',sqlca.sqlerrtext)
if trim(ls_return) <>'' then
else
messagebox('提示',ls_return)
end if
end if
  相关解决方案