PLSQL select into 为空的时候 报错的处理方法
PLSQL select into 为空的时候 报错的处理方法
在存储过程中select column into t_prop 。。。
当查询不到值的时候会报错,这时候的处理方法为:
使用聚合函数,比如:
- create or replace procedure test is
- t_prop varchar2(20);
- begin
- select max(sales_no) into t_prop from sales_card where 1=2;
- end test;
当然也要根据业务确定是否需要这样的数据
更多Oracle相关信息见Oracle 专题页面 http://www.bkjia.com/topicnews.aspx?tid=12
评论暂时关闭