Tuesday, March 3, 2009

Loops

Declare
v_Ctr Binary_Integer := 1;

Begin
While v_Ctr < 5 Loop
Do Something
v_Ctr := v_Ctr + 1;
End Loop;


Declare
v_Ctr Binary_Integer := 1;
v_Max Binary_Integer := &Max_Value;

Begin
Loop
Do Something
v_Ctr := v_Ctr + 1;
Exit When v_Ctr > v_Max;
End Loop;


/* v_Ctr Is Implicitly Declared As Binary_Integer. */
/* Can be a variable */
Begin
For v_Ctr In 1..Least(CtrA, CtrB) Loop
Do Something
End Loop;

No comments:

Post a Comment