创建存储过程
create or replace procedure proc_member_isvip(
       link_mobile in VARCHAR2,
       vip_level out int
)
is
begin
    select t.viplevel into vip_level from t_member t where t.linkmobile=link_mobile and rownum=1;
    --dbms_output.put_line(vip_level);
    --返回结果:0表示是,1表示不是,2表示其它
    if vip_level>0 then
    vip_level:=0;
    elsif vip_level=0 then
    vip_level:=1;
    else
    vip_level:=2;
    end if;
end;
测试用sql:
  declare
           level2 int;
     begin
           proc_member_isvip('13420986657',level2);
          dbms_output.put_line(level2);
     end;