Subject Re: Change column type NULL to NOT NULL
Author Alexander V.Nevsky
--- In firebird-support@yahoogroups.com, "skotaylor" <scott@d...>
wrote:
> 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. So at least

update table set column=something where column is null

is necessary. Usually more sophisticated algorithm is needed because
if you want this then it usually mean column should contain
substantial data not predicted in previous design.

Best regards,
Alexander.