SQL> create or replace package pkg_test1
2 as
3 function getArea (i_rad NUMBER) return NUMBER;
4 procedure p_print (i_str1 VARCHAR2 :='hello',
5 i_str2 VARCHAR2 :='world',
6 i_end VARCHAR2 :='!' );
7 end;
8 /
Package created.
SQL>
SQL> create or replace package body pkg_test1
2 as
3 function getArea (i_rad NUMBER)return NUMBER
4 is
5 v_pi NUMBER:=3.14;
6 begin
7 return v_pi * (i_rad ** 2);
8 end;
9
10 procedure p_print(i_str1 VARCHAR2 :='hello',
11 i_str2 VARCHAR2 :='world',
12 i_end VARCHAR2 :='!' )
13 is
14 begin
15 DBMS_OUTPUT.put_line(i_str1||','||i_str2||i_end);
16 end;
17 end;
18 /
Package body created.
|