码迷,mamicode.com
首页 > 其他好文 > 详细

存储过程中的循环和分支结构

时间:2014-09-15 15:41:49      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   os   ar   for   div   sp   log   

FOR i IN tRange1.first .. tRange1.last LOOP
  IF Instr(CardNum, tRange1(i), 1) = 1 THEN
    GLOBAL_VARBLE.nPos1 := i;
    Result := tBankName1(i);
    EXIT;
  END IF;
END LOOP;

for i in 1..100 loop
  t:=t+i;
  Dbms_Output.Put_Line(it‘‘s : || t);
end loop;

while i<=100 loop
  t:=t+i;
  i:=i+1;
  Dbms_Output.Put_Line(it‘‘s : || t);
end loop;

Loop
  i:=i+1;
  exit when i>100;
  t:=t+i;
  Dbms_Output.Put_Line(it‘‘s : || t);
end loop;

类switch:

CASE TradeType
  WHEN GLOBAL_VARBLE.POS_REPEAL THEN             --消费撤消
    lOrigType := GLOBAL_VARBLE.POS_CONSUME;
  WHEN GLOBAL_VARBLE.POS_UNCONSUME THEN          --消费冲正
    lOrigType := GLOBAL_VARBLE.POS_CONSUME;
END CASE ;

 

存储过程中的循环和分支结构

标签:style   blog   color   os   ar   for   div   sp   log   

原文地址:http://www.cnblogs.com/bitter-first-sweet-last/p/3972800.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!