|Subject||Re: [firebird-support] Constants|
> Is there any way to implement constants in database ?A configuration table is the only thing you can do.
> 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..
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Database development questions? Check the forum!