On 27-8-2013 20:12, Adriano dos Santos Fernandes wrote: > On 27/08/2013 15:06, Leyne, Sean wrote: >> >>>>> I think an USING clause would be a great addition: >>>>> >>>>> GENERATED BY DEFAULT AS IDENTITY [USING SEQUENCE <name>] >>>>> >>>>> What do you think? >>>> What Sequence (name) would be used if the USING was omitted? >>>> >>>> >>> A generated one, like now and like happens with constraints and indexes. >> Aren't IDENTITY values supposed to be unique/not shared across tables? (By >> allowing the Name to be specified, you would allow for a sequence to be >> shared, no?) > No, as I said to Dmitry, it's just a way to name the generated sequence. > >> Further, you propose that IDENTITY are the same as SEQUENCE/Generators, but >> this is not how most other engines have implemented the functionality, they >> treat Identity as different object from sequence (though very similar) to >> restrict operations on the values (not allow for the value to be managed). >> >> > The standard does not agree with you on this: "An identity column is > associated with an internal sequence generator SG".
The keyword being: internal sequence generator. If you look at the spec it says (4.15.11 in Foundation) "NOTE 44 — The notion of an internal sequence generator being associated with an identity column is used only for definitional purposes in this International Standard." It also defines that manipulation of this 'internal sequence generator' should go through the column (11.20 in Foundation). Identity columns are a separate object type that share some of the features and behaviors of sequences, but in my interpretation of the spec they are not sequences as such, nor should the backing sequence (implementation artifact) be directly manipulated as a normal sequence. Mark -- Mark Rotteveel ------------------------------------------------------------------------------ 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