SQL>
SQL> CREATE OR REPLACE PACKAGE datecalc
2 IS
3 PROCEDURE showage (birthday_in IN DATE);
4 PROCEDURE showage (birthday_in IN INTEGER);
5 PROCEDURE showage (birthday_in IN VARCHAR2, mask_in IN VARCHAR2 := NULL);
6 END datecalc;
7 /
Package created.
SQL>
SQL> show error
No errors.
SQL>
SQL> CREATE OR REPLACE PACKAGE BODY datecalc
2 IS
3 FUNCTION datestring (date_in IN DATE) RETURN VARCHAR2 IS
4 BEGIN
5 RETURN 'You are ' || ROUND (TO_NUMBER (SYSDATE - date_in)) || ' days old.';
6 END datestring;
7
8 PROCEDURE showage (birthday_in IN DATE) IS
9 BEGIN
10 DBMS_OUTPUT.PUT_LINE (datestring (birthday_in));
11 END showage;
12
13 PROCEDURE showage (birthday_in IN INTEGER) IS
14 BEGIN
15 showage (TO_DATE (birthday_in, 'J'));
16 END showage;
17
18 PROCEDURE showage (birthday_in IN VARCHAR2, mask_in IN VARCHAR2 := NULL) IS
19 BEGIN
20 IF mask_in IS NULL
21 THEN
22 showage (TO_DATE (birthday_in));
23 ELSE
24 showage (TO_DATE (birthday_in, mask_in));
25 END IF;
26 END showage;
27 END datecalc;
28 /
Package body created.
SQL> show error
No errors.
SQL>