如果mytable表中不存在 ID = 123 的数据,那么
SELECT Flag INTO flag FROM mytable WHERE ID = 123 将抛出异常ORA-01403
SELECT nvl(max(Flag),‘‘) INTO flag FROM mytable WHERE ID = 123 则不会有异常
具体参考:
http://www.itpub.net/thread-859456-1-1.html
时间: 2024-11-08 06:25:07
如果mytable表中不存在 ID = 123 的数据,那么
SELECT Flag INTO flag FROM mytable WHERE ID = 123 将抛出异常ORA-01403
SELECT nvl(max(Flag),‘‘) INTO flag FROM mytable WHERE ID = 123 则不会有异常
具体参考:
http://www.itpub.net/thread-859456-1-1.html