Subject RE: [firebird-support] Generator as default value?
Author agung wibowo
>I would like to use a generator to assign unique row numbers for
>various tables. I am familiar with the approach of defining an insert
>trigger for each table.
>Is there a simpler way to achieve this? I was hoping for one of the
>two options:
>(1) have the generator as the default value for the column, i.e.
>something like
>create table xyz ( xyzID DECIMAL(18) DEFAULT MyGenerator, ...)



AFAIK, we can't use generator value as default statement, but we can use
them in COMPUTED BY definition, so if I'm not wrong about your meant, you
can do this :



CREATE TABLE XYZ (XYZID BIGINT COMPUTED BY
(GEN_ID(MYGENERATOR,[somevalue]))



Hope, can help you





[Non-text portions of this message have been removed]