Subject | RE: [ib-support] Fw: NOT NULL question |
---|---|
Author | Martijn Tonies |
Post date | 2001-12-18T07:48:48Z |
Hi Helen,
One thing though, this constraint will show up as a CHECK CONSTRAINT and
will not show as a 'NOT NULL' field in the tools :)
It does work though :)
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
At 07:32 AM 18-12-01 +0100, Nico wrote:
ALTER TABLE ADD CONSTRAINT MyColNotNull
CHECK (MyCol is not null);
I'd want to add a trigger to write a default value as well....and I'm not
sure whether Prepare marks columns thus constrained as Required Fields in
Delphi.
If the table doesn't have any dependencies, an alternative would be to
create a duplicate table with NOT NULL on that column and pump the data
across, drop the original table, then duplicate the new table the same way.
Don't forget to go through and find existing nulls first!
cheers,
Helen
[Non-text portions of this message have been removed]
One thing though, this constraint will show up as a CHECK CONSTRAINT and
will not show as a 'NOT NULL' field in the tools :)
It does work though :)
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
At 07:32 AM 18-12-01 +0100, Nico wrote:
>Hi list,TABLE ? (Interbase 6).
>
> Is there a way to add a NOT NULL constraint to a column, with ALTER
ALTER TABLE ADD CONSTRAINT MyColNotNull
CHECK (MyCol is not null);
I'd want to add a trigger to write a default value as well....and I'm not
sure whether Prepare marks columns thus constrained as Required Fields in
Delphi.
If the table doesn't have any dependencies, an alternative would be to
create a duplicate table with NOT NULL on that column and pump the data
across, drop the original table, then duplicate the new table the same way.
Don't forget to go through and find existing nulls first!
cheers,
Helen
[Non-text portions of this message have been removed]