Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] SQL improvement: allow computed fields to be defined as a domain [CORE4476] #4796

Open
firebird-automations opened this issue Jun 29, 2014 · 0 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Robert (rj1102)

Normal fields and identity fields (as of FB3) can be defined both as data type and domain.
However computed fields can only be defined as datatype.

To have a more consistent and better support of the SQL standard, I like to request that computed fields can also be defined as a domain. Above that, using domains is a good way to standarize data type usage in your database, so it is good idea to have them also available for computed fields.

For example:

SQL-2003 standard for field definition (shortened):
<column definition> ::= <column name> [ <data type> | <domain name> ]

CREATE TABLE MyTable
(
MyComputedField GENERATED ALWAYS AS (2*2), /* data type will be determined implicitly */
MyComputedField INTEGER GENERATED ALWAYS AS (2*2), /* computed field as explicit data type */
MyComputedField NumericDomain GENEARTED ALWAYS AS (2*2) /* computed field as explicit domain, -- not supported yet -- */
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant