Subject | Re: [firebird-support] Re: Change column type NULL to NOT NULL |
---|---|
Author | Daniel Rail |
Post date | 2003-11-20T18:11:01Z |
Hi,
At November 20, 2003, 13:44, Alexander V.Nevsky wrote:
NULL to NOT NULL, is a simple check on all the values of that field to
make sure that no values are NULL. And, if all the values are NOT
NULL, then add the NOT NULL constraint, otherwise return an error
message indicating that it cannot be performed because at least on
value is NULL. I know, this can be an expensive task, if there are a
lot of rows in the table. It could be added as a feature request in
the tracker.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)
At November 20, 2003, 13:44, Alexander V.Nevsky wrote:
> wrote:Maybe what is required in the engine, before changing a field from
>> I'm having an SQL <alt_col_clause> crisis. Trying to follow the
>> SQLRef for ALTER TABLE and can't seem to quite get the right syntax.
>> I want to convert a NULL field to be NOT NULL.
> This opertion can't be made using ALTER TABLE. Why - I don't know.
> Popular interactive tools allow this making updates of system tables.
> I'm sure about IBExpert, seems IBWorkBench allow this too. Beware - if
> columns really conatins nulls, gbk of this database will be
> unrestorable after this, perhaps this is the reason why such alter is
> not performed by standard DDL statement.
NULL to NOT NULL, is a simple check on all the values of that field to
make sure that no values are NULL. And, if all the values are NOT
NULL, then add the NOT NULL constraint, otherwise return an error
message indicating that it cannot be performed because at least on
value is NULL. I know, this can be an expensive task, if there are a
lot of rows in the table. It could be added as a feature request in
the tracker.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)