▣ 단 입력 받아 구구단 출력
SQL> create or replace procedure gugu2(dan number)
2 as
3 begin
4 for i in 1..9 loop
5 dbms_output.put_line(dan || 'x' || i || '=' || dan*i);
6 end loop;
7 end;
8 /
Procedure created.
SQL> exec gugu2(4);
4x1=4
4x2=8
4x3=12
4x4=16
4x5=20
4x6=24
4x7=28
4x8=32
4x9=36
PL/SQL procedure successfully completed.
▣ 수 입력받아 + 연산
SQL> create or replace procedure plus(s1 number,s2 number)
2 as
3 begin
4 dbms_output.put_line('s1 + s1 =' || (s1+s2));
5 end;
6 /
Procedure created.
SQL> exec plus(1,2);
s1 + s1 =3
PL/SQL procedure successfully completed.
댓글 없음:
댓글 쓰기