Re: Informix pop quiz
Posted in 2008
Topics: General Discussion
>The column is part of a primary key constraint?
correct. why does it allow creation of a PKY column
(even one single column is allowed) but fails at
insert.
create table testnull (fld1 integer primary key ) ;Table created.
insert into testnull values(NULL); 703: Primary key on table (testnull) has a field with a null key value.
Error in line 4Near character position 32
dcruncher4@aim.com wrote:
>> The column is part of a primary key constraint?
>>
>
> correct. why does it allow creation of a PKY column
> (even one single column is allowed) but fails at
> insert.
>
> create table testnull (fld1 integer primary key ) ;> Table created.
>
> insert into testnull values(NULL);> 703: Primary key on table (testnull) has a field with a null key value.
> Error in line 4> Near character position 32
>
Is this a valid point at which to say "RTFM"?
A declared primary key implies two things:
1. uniqueness and
2. no nulls.
It doesn't matter what the column definition is.
--
Cheers,
Obnoxio the Clown
http://obotheclown.blogspot.com