Subject | Re: [firebird-support] Alter Colum to set a Default Value |
---|---|
Author | Michael Ludwig |
Post date | 2010-06-03T07:34:36Z |
Marius Labuschagne schrieb am 03.06.2010 um 08:34:39 (+0200):
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
> Is it possible to issue a statement to change or set the default valueIt can be done like this:
> 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.
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