Subject Re: [firebird-support] default value
Author Markus Ostenried
On 12/20/06, Nick Upson <nick.upson@...> wrote:
> if I do this (there is 1 row already in the table)
>
> ALTER TABLE mytable add test Integer DEFAULT 0 NOT NULL;
> commit;

The default value you specified is only used if you are inserting a
new record and if your insert statement does not contain the
test-field.
When altering a table like this the default isn't applied to already
existing records. You should always execute an update statement after
adding a not-null-field to fill the field for existing records
yourself.

bye,
Markus