首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

存储过程出错了,帮见见是什么原因

2014-01-05 
存储过程出错了,帮看看是什么原因刚接触存储过程,试着写了一个。运行的时候说:Warning: 执行完毕, 但带有警

存储过程出错了,帮看看是什么原因
刚接触存储过程,试着写了一个。

运行的时候说:
Warning: 执行完毕, 但带有警告
PROCEDURE SP_INSERT_XQ 已编译。

用exec PROCEDURE SP_INSERT_XQ('','');运行的时候,出错了。

下面是我写的存储过程,大家帮看看。


create or replace PROCEDURE SP_INSERT_XQ
(
   xqmc in VARCHAR2(30),
   ssqh in VARCHAR2(12)

AS
  str_xqbm NUMBER;
  jls NUMBER;
  str_tmp VARCHAR2(2);
begin
  select count(*) INTO jls from qh where sjqhbm=ssqh and substr(qhbm, 13, 2) <> '99' and qhjb=''6'
  if(jls=0)  then
   insert into qh(qhbm,qhmc,sjqhbm,tbrq) values(ssqh+'01',xqmc,ssqh,SYSDATE);
  else 
   select max(qhbm) into str_xqbm from qh where sjqhbm=ssqh and substr(qhbm, 13, 2) <> '99' and  substr(qhbm, 13, 2) <> '98' an qhjb='6';
   str_tmp := to_char(substr(str_xqbm,13,14))+1);
   if length(str_tmp)=1 then
   str_tmp :='0' +str_tmp;
   end if;
   insert into qh(qhbm,qhmc,sjqhbm,tbrq) values(ssqh+str_tmp,xqmc,ssqh,SYSDATE);
end if;
END SP_INSERT_XQ

[解决办法]
所有拼接字符串的+改成
[解决办法]
在PLSQL中选中存储过程,右键,选调试,然后按F9进入单步调试。

热点排行