您的位置:首页 > 数据库

PL/SQL个人学习笔记(二)

2014-09-02 09:06 351 查看
IF条件

declare 

  cursor s is 

          select version from city_server t;

  s_ city_server.version%type;

begin

  open s;

  fetch s into s_;

        if s_>2 

          then

        DBMS_OUTPUT.put_line(s_);

        end if;

  close s;
end;

LOOP循环

declare 

  cursor s is 

          select version from city_server t;

  s_ city_server.version%type;

begin

  open s;

  loop

      fetch s into s_;

        exit when s%notfound;

        DBMS_OUTPUT.put_line(s_);

  end loop;

  close s;

end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  plsql