Subject | RE: [ib-support] Create Table |
---|---|
Author | Martijn Tonies |
Post date | 2002-03-06T08:40:49Z |
Hi,
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?
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
[Non-text portions of this message have been removed]
>create table test1 (Besides Claudios answer:
>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 (
>number integer computed by (gen_id (gen_test, 1)) not null,
>age integer check (age > 20),
>name varchar (20),
>constraint pk_gorilla primary key(number))
>
>(doesn't work: why? I don't know.)
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?
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
[Non-text portions of this message have been removed]