Java,J2EE,Weblogic,Oracle

java项目随笔
随笔 - 90, 文章 - 6, 评论 - 61, 引用 - 0
数据加载中……

oracle存储过程

创建存储过程
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;

posted on 2007-06-07 14:58 龚椿深 阅读(185) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: