Hi,
I like to propose a more consistent syntax for computed columns and identity
columns:
Computed columns are now defined in DDL as
<ColumnName> [<DataType>] GENERATED ALWAYS AS (<Expression>)
while identity columns (as of FB 3.0 CORE-1385) are defined as:
<ColumnName> {<DataType>|<DomainName>} GENERATED {ALWAYS|BY DEFAULT} AS
IDENITITY
Note the differences:
- for computed columns the datatype is optional (if ommitted the system will
find an appropriate datatype)
- identity columns can be defined as both datatype and domain, where computed
columns can only be defined as datatype
- identity columns can be defined as both ALWAYS (although not yet implemented)
and BY DEFAULT, while computed columns can only be defined as ALWAYS
To make this more consistent, I like to propose to:
- also support domains for computed columns;
- also make the specification of datatype/domain for identity columns optional
(if it is ommitted the system should assume INTEGER);
- also support GENERATED BY DEFAULT for computed columns.
The syntax will then also be more generic (covering both computed and identity
columns):
generated column specification ::= <ColumnName> [{<DataType>|<DomainName>}]
GENERATED {ALWAYS|BY DEFAULT} AS {(<Expression>)|IDENTITY}
What do you think?
Kind regard,
Robert NL
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel