Subject | Constants |
---|---|
Author | Adomas Urbanavicius |
Post date | 2005-11-10T09:56:04Z |
Hi,
Is there any way to implement constants in database ?
We are using some custom user rights in applications, which are defined
as constants in code (C++,something like #define
C_IALLOW_VIEW_HISTORY_OLDER1YEAR 15; or static const
C_IALLOW_VIEW_HISTORY_OLDER1YEAR = 15, NATIONAL_CURRENCY, etc), for
obvious reasons we dont want to hardcode number 15, "USD" in PL\SQL.
(Now we are using configuration table, like const_name, number; I think
about writing udf with GetConst("NAME")), but it would be much better,
to add somewhere include of our header with constants, and then just use
it with : if Custom_Right <> C_IALLOW_VIEW_HISTORY_OLDER1YEAR then ....,
or insert into orders ... NATIONAL_CURRENCY..
Adomas
Is there any way to implement constants in database ?
We are using some custom user rights in applications, which are defined
as constants in code (C++,something like #define
C_IALLOW_VIEW_HISTORY_OLDER1YEAR 15; or static const
C_IALLOW_VIEW_HISTORY_OLDER1YEAR = 15, NATIONAL_CURRENCY, etc), for
obvious reasons we dont want to hardcode number 15, "USD" in PL\SQL.
(Now we are using configuration table, like const_name, number; I think
about writing udf with GetConst("NAME")), but it would be much better,
to add somewhere include of our header with constants, and then just use
it with : if Custom_Right <> C_IALLOW_VIEW_HISTORY_OLDER1YEAR then ....,
or insert into orders ... NATIONAL_CURRENCY..
Adomas