Subject | Generator as default value? |
---|---|
Author | yuraukar |
Post date | 2005-01-24T09:29:40Z |
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, ...)
(2) define a domain that has the generator as the default value, i.e.
create CREATE DOMAIN INT64 AS DECIMAL(18,0) default MyGenerator
and then
create table xyz (xyzID INT64, ...)
Neither syntax works and I was wondering if there is a workaround
solution to get it working.
Anohter question here: what is the preferred data type for this?
DECIMAL(18)? BIGINT? Is there no unsigned BIGINT?
Thanks for feedback.
Yuraukar
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, ...)
(2) define a domain that has the generator as the default value, i.e.
create CREATE DOMAIN INT64 AS DECIMAL(18,0) default MyGenerator
and then
create table xyz (xyzID INT64, ...)
Neither syntax works and I was wondering if there is a workaround
solution to get it working.
Anohter question here: what is the preferred data type for this?
DECIMAL(18)? BIGINT? Is there no unsigned BIGINT?
Thanks for feedback.
Yuraukar