oracle存储过程里的ifelse语句这样写,想想也是醉了
if dwxh = 1 then
num1 := num_sum;
elsif dwxh = 2 then
num2 := num_sum;
elsif dwxh = 3 then
num3 := num_sum;
elsif dwxh = 4 then
num4 := num_sum;
elsif dwxh = 5 then
num5 := num_sum;
elsif dwxh = 6 then
num6 := num_sum;
elsif dwxh = 7 then
num7 := num_sum;
elsif dwxh = 8 then
num8 := num_sum;
elsif dwxh = 9 then
num9 := num_sum;
end if;
之前每个都写
else if …..then
end if;
就报错呵呵呵呵~~
本文探讨了在Oracle存储过程中使用IF-ELSE语句的一种特殊写法,避免了每个条件后都写END IF而导致的错误,并分享了一种简洁有效的实现方式。
5万+

被折叠的 条评论
为什么被折叠?



