ORA-01403未找到数据

 ORA-01403未找到数据的错误。其中jkcode,serialid是varchar2(64)。语句是这样的:

select

     jk_code,serial_id into jkcode,serialid

from

    contract_account,customer,mp,meter

where

    contract_account.customer_id=customer.customer_id and contract_account.contrac_id=mp.contrac_id

    and mp.mp_jd=meter.mp_id and meter.meter_id=meter_cursor.newmeterid;

 原来根据某些 meter_cursor.newmeterid查不到jk-code与serial-id即查到0条,我猜测在into的时候有问题。具体为什么不行我 也不是很晓得。但是能知道要是查不到信息into就提示上面的错误。解决办法很容易就是将这个语句复制一下,先计算count(*)如果为0就不执行,如 果》0就执行上面的语句。

posted @ 2013-01-29 21:07  王超_cc  阅读(3911)  评论(0编辑  收藏  举报