Subject Re: [firebird-support] Alter Colum to set a Default Value
Author Michael Ludwig
Marius Labuschagne schrieb am 03.06.2010 um 08:34:39 (+0200):

> Is it possible to issue a statement to change or set the default value
> for an existing column?

> The StockType field is already in the database table with a
> varchar(20) definition, I just need to add a default value for this
> field.

It can be done like this:

SQL> show table t;
A INTEGER Not Null
B SMALLINT Not Null
SQL> alter table t alter column b set default 99;
SQL> commit;
SQL> show table t;
A INTEGER Not Null
B SMALLINT Not Null default 99

--
Michael Ludwig