Subject RE: [ib-support] Create Table
Author Helen Borrie
At 09:40 AM 06-03-02 +0100, you wrote:
>Hi,
>
> >create table test1 (
> >number integer computed by (gen_id (gen_test, 1)),
> >age integer check (age > 20),
> >name varchar (20))
> >
> >(Works)
> >
> >create table test2 (
> >number integer not null computed by (gen_id (gen_test, 1)),
> >age integer check (age > 20),
> >name varchar (20),
> >constraint pk_gorilla primary key(number))
> >
> >or
> >
> >create table test2 (
>
>a PK on a COMPUTED column? As COMPUTED column values aren't stored,
>selecting from the above table (if it worked) would result in actually
>changing the visible value in column NUMBER because of the GEN_ID
>function.
>
>And, as the values aren't stored, how can a PK be created?

Agreed - but the parser spit out on the NOT NULL constraint and didn't
reach the PK clause...I didn't expect it to allow the PK but I was
surprised that it disallowed NOT NULL.

Helen

All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________