Subject Re: [firebird-support] Constants
Author Martijn Tonies
> 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
> 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..

A configuration table is the only thing you can do.

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Upscene Productions
Database development questions? Check the forum!