Opening Hours :7AM to 9PM
WHILE condition LOOP sequence_of_statements END LOOP;
DECLARE a number(2) := 1; BEGIN WHILE a <= 10 LOOP dbms_output.put_line('value of a: ' || a); a := a + 1; END LOOP; END; /When the above code is executed at the SQL prompt, it produces the following result −
DECLARE a number(2) := 10; BEGIN WHILE a >= 1 LOOP dbms_output.put_line('value of a: ' || a); a := a - 1; END LOOP; END; /When the above code is executed at the SQL prompt, it produces the following result −
while(condition) loop while(condition) loop ... .. end loop; .. .. end loop;
*** *** *** *** *** *** declare r int; c int; begin r:=1; while(r<=6) loop c:=1; while(c<=3) loop dbms_output.put('*'); c:=c+1; end loop; dbms_output.put_line(''); r:=r+1; end loop; end; /
* ** *** **** ***** ****** declare r int; c int; begin r:=1; while(r<=6) loop c:=1; while(c<=r) loop dbms_output.put('*'); c:=c+1; end loop; dbms_output.put_line(''); r:=r+1; end loop; end; /
****** ***** **** *** ** * declare r int; c int; begin r:=1; while(r<=6) loop c:=6; while(c>=r) loop dbms_output.put('*'); c:=c-1; end loop; dbms_output.put_line(''); r:=r+1; end loop; end; /
******* * * * * * * * * * * ******* declare r int; c int; begin r:=1; while(r<=7) loop c:=7; while(c>=1) loop if(r=1 or c=1 or r=7 or c=7) then dbms_output.put('*'); else dbms_output.put(' '); end if; c:=c-1; end loop; dbms_output.put_line(''); r:=r+1; end loop; end; /
* * * ******* * * *
declare r int; c int; begin r:=1; while(r<=7) loop c:=7; while(c>=1) loop if(r=4 or c=4 ) then dbms_output.put('*'); else dbms_output.put(' '); end if; c:=c-1; end loop; dbms_output.put_line(''); r:=r+1; end loop; end; /
* ** *** **** ***** ****** ******* declare r int; c int; begin r:=1; while(r<=7) loop c:=7; while(c>=1) loop if(r>=c ) then dbms_output.put('*'); else dbms_output.put(' '); end if; c:=c-1; end loop; dbms_output.put_line(''); r:=r+1; end loop; end; /