A centralized method for defining and enforcing strong-typing among
domains in RDBMS or ORDBMS is provided to allow flexible, easy, and quick
domain creation, as well as facilitating easy implementation and change
control on domains. When an application requests data from the database,
one or more domains are first identified in the SQL query. A
determination is then made as to whether operators for each domain pair
in the SQL query are authorized. A determination is also made as to
whether functions in the SQL authorized. If the operators and functions
in the SQL are authorized, the initial SQL request is rewritten to
include a casting formula for each domain pair operation. The rewritten
SQL request is then executed.