日期:2014-05-17  浏览次数:20686 次

存储过程的IF问题
我想问下,oracle的存储过程中,能否在IF条件中,多写几个条件?

类似JAVA那样 if(a==2 || a==2....)这样。

因为我有一个存储过程要写IF,可以有很多个如果,但是就执行2种结果。我不想写很多if then elsif这样。

请问可以吗?谢了~~

------解决方案--------------------
of course.

If a=1 or a=2 then

elsif 

else

end if;
------解决方案--------------------
可以这么写
if (a<>1 or b<> 2 or c<> 3) and n>0 then 
elsif n>0 
then
else
end if;[code=SQL][/code]
------解决方案--------------------
if (a<>1 or b<> 2 or c<> 3) and n>0 then
elsif n>0
then
else
end if;
------解决方案--------------------
if a=2 or b=3 ... then
end if;
我的异常网推荐解决方案:oracle存储过程,http://www.aiyiweb.com/oracle-develop/177537.html