Interesting table

Monday, January 07, 2008

create table test (a integer not null generated always as identity (start with 1 increment by 1))

I cannot insert data since a is defined with "generated always", and there aint no other columns. This is a hole, just found this when I was taking prescription for everyday boredom.

1 comments:

insert into test3 values(default) works ..
From description of DEFAULT in VALUES clause in the reference:

DEFAULT
Specifies that the default value is assigned to a column. The value that
is inserted depends on how the column was defined, as follows:
* If the column is a ROWID or identity column, the database manager will generate a new value.

DEFAULT must be specified for a ROWID or an identity column that was defined as GENERATED ALWAYS unless OVERRIDING USER VALUE is specified to indicate that any user-specified value will be ignored and a unique system-generated value will be inserted.

Agoglife said...
1/07/2008 4:17 PM  

Post a Comment