为什么会这样??? select 到的纪录数目不等于1就会异常你在sqlplus里面执行select health_content into out_content from dw_health_content where sequence_no=2;看看结果集有几条 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果有数条记录的话,可以用游标来做。可以通过select count(health_content) into count_num from dw_health_content where sequence_no=2;来判断是否有记录集,是否为空 select 得到0条记录,可是health_content不是空值吗,为什么不直接走if的循环呢,我如果想让它执行后面的if循环需要怎么做呢,谢谢!!! select语句会打开一个隐式游标,若结果集为空(即你这里select的结果是0),将引发no_data_found的异常,你需要捕获这个异常,在异常中写你的if代码 begin select health_content into out_content from dw_health_content where sequence_no=2; out_ret:=0;exceptioin when no_data_found then out_ret:=1;end; oracle 蓝屏 我要实现这样的情况应该如何写视图? 如果在存储过程中将查询的结果集生成一个xml文件? ORALCE9I安装中出现的问题~及LDAP问题 在SQL*PLUS中如何建立表空间?为什么要建立表空间呢? procedure裡面怎麼樣只存日期而不要存時間 问一下Oracle的默认用户的密码(在线等回答) 登陆问题 在oracle不能运行这样的SQL语句的吗,怎么总是出错? 触发器总是提示“无法从套接字读取更多数据” 问一个比较弱的问题:在ORACLE什么是方案,为什么表都放在方案中呢? 请问在Oracle中,怎么样在两个表之间关联呢
可以通过select count(health_content) into count_num from dw_health_content where sequence_no=2;来判断是否有记录集,是否为空
select health_content into out_content from dw_health_content where sequence_no=2;
out_ret:=0;
exceptioin
when no_data_found then
out_ret:=1;
end;