db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik" <Dag.Wan...@Sun.COM>
Subject syntax for generated-column-spec: bug in doc or code?
Date Mon, 02 Oct 2006 17:10:30 GMT

Hi,

The 10.2 reference manual states
(http://db.apache.org/derby/docs/10.2/ref/rrefsqlj37836.html):

> GENERATED ALWAYS
> 
>     An identity column that is GENERATED ALWAYS will increment the
>     default value on every insertion and will store the incremented
>     value into the column. Unlike other defaults, you cannot insert a
>     value directly into or update an identity column that is GENERATED
>     ALWAYS. Instead, either specify the DEFAULT keyword when inserting
>     into the identity column, or leave the identity column out of the
>     insertion column list altogether. For example:
> 
>     create table greetings
>     	(i int generated always as identity, ch char(50));
>     insert into greetings values (DEFAULT, 'hello');
>     insert into greetings(ch) values ('bonjour');

However, when I try this I get an error:

ij> create table greetings ( i int generated always as identity, ch char(50));
0 rows inserted/updated/deleted
ij> insert into greetings values (DEFAULT, 'hello');
1 row inserted/updated/deleted
ij> insert into greetings values ('bonjour');
ERROR 42802: The number of values assigned is not the same as the number of specified or implied
columns.

Is this a documentation error or is this a bug?  Did not find any open
issue on this.

Dag

Mime
View raw message