为什么没人回答我
我熟悉sybase,SQL server,两星期前才接触Oracle,执行过程PL/SQL时有个错误。
过程大致如下,
create or replace procedure ppp is
rownumber number(1);
cusor cur_ppp is
select t1,t2 from ttt;
begin
open ppp;
loop;
fetch cur_ppp into a_t1,a_t2 ;
exit when cur_ppp %NOTFOUND;
select count(*) into rownumber from sss
where s1=a_t1;
if rownumber >0 then
update sss
set s2:=a_t2
where s1=a_t1;
else
insert sss(s1,s2)
values (a_t1,a_t2);
end if ;
end loop;
close cur_ppp ;
commit;
end ppp;
程序执行时,
错误报告为ORA_06502:"PL/SQL;numeric value error".
原因为"The valid range for the threshold argument to similar() function is from 0.0 to 100.0."
建议修改为"Correct then statement and try again".
DEbug 发现select count(*) into rownumber from sss where s1=a_t1; 有问题,
s1是 sss unique index,也就是rownumber只能为1/0;
该语句成功执行了十几遍了,我把参数a_t1找到,在SQLPLUS中执行该语句,结果为0。
这个问题困饶了我几天了,脑袋想瓜了,各位行行好,拉小妹一把。
从sybase,SQL server到Oracle,有何值得注意问题,望告之。