Opening Hours :7AM to 9PM
FOR counter IN initial_value .. final_value LOOP sequence_of_statements; END LOOP;
DECLARE a int; BEGIN FOR a in 1 .. 10 LOOP dbms_output.put_line('value of a: ' || a); END LOOP; END; /Output:
DECLARE a int ; BEGIN FOR a IN REVERSE 10 .. 1 LOOP dbms_output.put_line('value of a: ' || a); END LOOP; END; /Output:
FOR counter IN initial_value .. final_value LOOP FOR counter IN initial_value .. final_value LOOP sequence_of_statements; END LOOP; sequence_of_statements; END LOOP;in the above syntax
*** *** *** *** *** *** declare r int; c int; begin for r in 1..6 loop for c in 1..3 loop dbms_output.put('*'); end loop; dbms_output.put_line(''); end loop; end; /
* ** *** **** ***** ****** declare r int; c int; begin for r in 1..6 loop for c in 1..r loop dbms_output.put('*'); end loop; dbms_output.put_line(''); end loop; end; /
****** ***** **** *** ** * declare r int; c int; begin for r in 1..6 loop for c in reverse r..6 loop dbms_output.put('*'); end loop; dbms_output.put_line(''); end loop; end; /
******* * * * * * * * * * * ******* declare r int; c int; begin for r in 1..7 loop for c in reverse 1..7 loop if(r=1 or c=1 or r=7 or c=7) then dbms_output.put('*'); else dbms_output.put(' '); end if; end loop; dbms_output.put_line(''); end loop; end; /
* * * ******* * * * declare r int; c int; begin for r in 1..7 loop for c in reverse 1..7 loop if(r=4 or c=4) then dbms_output.put('*'); else dbms_output.put(' '); end if; end loop; dbms_output.put_line(''); end loop; end; /
* ** *** **** ***** ****** ******* declare r int; c int; begin for r in 1..7 loop for c in reverse 1..7 loop if(r>=c) then dbms_output.put('*'); else dbms_output.put(' '); end if; end loop; dbms_output.put_line(''); end loop; end; /