Subject Re: [ib-support] Create Table
Author Ann W. Harrison
>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))

The real answer is that generators were added after the
code that handled defaults. That's probably a good idea
for a feature.

At 03:35 PM 3/6/2002 +1100, Helen Borrie wrote:

>create table test1 (
>number integer computed by (gen_id (gen_test, 1)),
>age integer check (age > 20),
>name varchar (20))

That's going to give you a different value for number
every time the record is read. Remember, computed fields
are computed on reference.

As for computed and not null, that's a reasonable restriction.
There's no way to do a meaningful null test on a computed field.

The null state of a computed field may depend on values outside
the table - you could easily make the field null without touching
the record. Then the next time you tried to modify the record
you'd get an error.


Regards,

Ann
www.ibphoenix.com
We have answers.