读书人

存储过程的IF有关问题

发布时间: 2013-03-26 21:10:10 作者: rapoo

存储过程的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.myexception.cn/oracle-develop/177537.html

读书人网 >oracle

热点推荐