Subject | Re: [ib-support] NOT NULL constraints and the System Tables |
---|---|
Author | Martijn Tonies |
Post date | 2001-11-15T11:59:44Z |
Hi,
I've just tested with the latest FB release and IB too, just modifying the RDB$NULL_FLAG does the trick. But, when setting it to 0 or NULL, the constraint in rdb$relation_constraints and rdb$check_constraints doesn't get dropped automagically... Is this as expected or not?
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
Upscene Productions
http://www.upscene.com
"This is an object-oriented system.
If we change anything, the users object."
I finished this problem.
This is my table
CREATE TABLE "T1"
(
"T1" INTEGER NOT NULL,
"T2" INTEGER NOT NULL,
PRIMARY KEY ("T1")
);
But T2 field can be null.
Before, you must learn the constraint name.
For that look at the RDB$RELATION_CONSTRAINTS table.
When I look at this table I saw that
RDB$CONSTRAINT_NAME=INTEG_7
RDB$CONSTRAINT_TYPE=NOT NULL
RDB$RELATION_NAME=T1
Drop the not null constraint:
UPDATE RDB$RELATION_FIELDS
SET
RDB$NULL_FLAG=NULL
WHERE
(RDB$FIELD_NAME = 'T2') AND
(RDB$RELATION_NAME='T1');
[Non-text portions of this message have been removed]
I've just tested with the latest FB release and IB too, just modifying the RDB$NULL_FLAG does the trick. But, when setting it to 0 or NULL, the constraint in rdb$relation_constraints and rdb$check_constraints doesn't get dropped automagically... Is this as expected or not?
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
Upscene Productions
http://www.upscene.com
"This is an object-oriented system.
If we change anything, the users object."
I finished this problem.
This is my table
CREATE TABLE "T1"
(
"T1" INTEGER NOT NULL,
"T2" INTEGER NOT NULL,
PRIMARY KEY ("T1")
);
But T2 field can be null.
Before, you must learn the constraint name.
For that look at the RDB$RELATION_CONSTRAINTS table.
When I look at this table I saw that
RDB$CONSTRAINT_NAME=INTEG_7
RDB$CONSTRAINT_TYPE=NOT NULL
RDB$RELATION_NAME=T1
Drop the not null constraint:
UPDATE RDB$RELATION_FIELDS
SET
RDB$NULL_FLAG=NULL
WHERE
(RDB$FIELD_NAME = 'T2') AND
(RDB$RELATION_NAME='T1');
[Non-text portions of this message have been removed]