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

来源:互联网 发布:javascript教程视频 编辑:程序博客网 时间:2024/04/26 12:21
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;


0 0
原创粉丝点击