Subject RE: [ib-support] NOT NULL constraints and the System Tables
Author Martijn Tonies
Hi,

> > I noticed that the RDB$NULL_FLAG in the RDB$RELATION_FIELDS
> > is set to 0 and
> > the corresponding record in RDB$FIELDS has a NULL state for
> > RDB$NULL_FLAG. I
> > changed the RDB$NULL_FLAG in RDB$RELATION_FIELDS to NULL, but
> > that didn't
> > help... I still cannot insert NULLs into the column.
> >
> > What do I have to do to get the field NULLable and how do I
> > do the reverse
> > (NULLable to NOT NULLable).
>
> Hmmm, weird. I used to try the following statement to drop
> the NOT NULL
> constraint:
>
> update RDB$RELATION_FIELDS
> set RDB$NULL_FLAG = null
> where RDB$FIELD_NAME = <FIELD_NAME>
> and RDB$RELATION_NAME = <TABLE_NAME>;
>
> and the following one to recreate it:
>
> update RDB$RELATION_FIELDS
> set RDB$NULL_FLAG = 1
> where RDB$FIELD_NAME = <FIELD_NAME>
> and RDB$RELATION_NAME = <TABLE_NAME>;
>
> If my memory is correct, the both statements worked fine for me.
>
> Cheers,
> Dmitry

And what about dropping the constraint via ALTER TABLE DROP CONSTRAINT - it
_seems_ to drop the constraint... And I believe that Claudio once posted
something like that...


Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com


[Non-text portions of this message have been removed]