Subject NOT NULL constraints and the System Tables
Author Martijn Tonies
Hi all,

I'm trying to figure out how to drop NOT NULL column constraints.

I've looked up the constraint name via the RDB$RELATION_CONSTRAINTS table.
When I issue a 'alter table [table] drop constraint [constraint]', it
doesn't complain and the corresponding record in RDB$CHECK_CONSTRAINTS is
deleted as well.

However, when I issue a statement to insert a NULL into the column, it
fails, telling me that it should be NOT NULL.

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


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








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