Subject Re: [ib-support] Create Table
Author Helen Borrie
At 12:26 PM 06-03-02 +1300, Sandeep wrote:
>Why isn't the following allowed ?
>
>create table test (
>number integer default gen_id (gen_test, 1),
>age integer check (age > 20),
>name varchar (20))

ISC ERROR CODE:335544569

ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 2, char 24
gen_id

(A default has to be a constant...)

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 (
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.)

cheers,
H.

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