为什么没人回答我

happygirl 2001-11-05 11:57:31
我熟悉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,有何值得注意问题,望告之。




...全文
35 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwl007 2001-11-05
  • 打赏
  • 举报
回复
open ppp;
不对啊!你好好看以下

34,593

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧