oracle存储过程中的if...elseif...else用法

时间:2023-03-10 02:27:33
oracle存储过程中的if...elseif...else用法

if ... then 
...   
elsif ... then 
...

else 
...   
end if;

or     
if ... then     
  ...   
else 
...   
end if;   
    
or     
if ... then 
...   
end if;

注:if后的条件不加括号

例子如下:
           if   p_fh <> ''   then
               p_strsql := p_strsql || ' and b.fh = p_fh';
           end if;