Subject | Re: [firebird-support] default value |
---|---|
Author | Markus Ostenried |
Post date | 2006-12-20T13:34:37Z |
On 12/20/06, Nick Upson <nick.upson@...> wrote:
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
> if I do this (there is 1 row already in the table)The default value you specified is only used if you are inserting a
>
> ALTER TABLE mytable add test Integer DEFAULT 0 NOT NULL;
> commit;
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