Majico
Majico

Reputation: 3830

PL/SQL, how to put common code lines of packages in a shared package

I have several packages which some of their Specification and body lines are the same, so I would like to put all the same codes in a Common package and share that package in all. For procedures body, it was not so difficualt as I defined a Main procedure in my Common package and I used it in other packages, but how can I do the same for Specifications ?

suppose I have some common variable or constant variable:

CNST_S_DATA_MINIMA constant        varchar2 (10) := '1900-01-01';
CNST_D_DATA_MINIMA constant        date := To_date (CNST_S_DATA_MINIMA, CNST_S_FORMATO_DATE);
ERR__VOID_PARAMETER EXCEPTION;

Upvotes: 0

Views: 383

Answers (1)

Erich Kitzmueller
Erich Kitzmueller

Reputation: 36987

Simply put them into the package specification (not body) of a package that is used as the container for such global constants.

Upvotes: 2

Related Questions