Oracle -plSQL을 이용한 구구단 출력하기 (loop구문)
set serveroutput on
declare
dan number:=1;
i number:=1;
begin
loop
i:=1;
dan:=dan+1;
loop
dbms_output.put(dan||'*'||i||'='||(dan*i)||' ');
i:=i+1;
if i>9 then
dbms_output.new_line;
exit;
end if;
end loop;
if dan>=9 then
exit;
end if;
end loop;
end;
댓글