SQL> create or replace package empch10 is procedure printef1(eno in number,n out varchar2,s out num
ber,d out varchar2);
2 function area(b number, h number)
3 return number;
4 end empch10;
5 /
Package created.
SQL> create or replace package body empch10 as procedure printef1(eno in number,n out varchar2,s out
number,d out varchar2)is
2 ena varchar2(10);
3 csal varchar(7,2);
4 desg varchar2(9);
5 begin
6 select ename,sal,job into ena,esal,desg from emp where empno:=eno;
7 n:-=ena;
8 s:=csal;
9 d:=desg;
10 end printef1;
11 function area(b number,h number)
12 return number is
13 a number;
14 begin
15 a:=1/2*b*h;
16 return a;
17 end area;
18 end empch10;
19 input truncated to 18 characters
20 /
Package Body created.
SQL> declare
2 a number;
3 e varchar2(10);
4 b number;
5 c varchar2(9);
6 Begin
7 a:=&a;
8 empch10.printcf(a,c,b,c);
9 dbms_output.put_line(e||'--->'||b||'--->'||c);
10 end;
11 /
SQL> declare
2 a number;
3 b number;
4 c number;
5 begin
6 a:=&a;
7 b:=&b;
8 c:=empch10.area(a,b);
9 dbms_output.put_line('the result is:'||c);
10 end;