Subject Re: [ib-support] Adding a default value for a field
Author Claudio Valderrama C.
""Stevio"" <redeagle@...> wrote in message
> Hi all,
> How can I specify a default value for a field that already exists in a
> table?
> The field is called IS_DELETED and is specified as follows:
> I want it to have a default value of F (for false).

create domain d_is_deleted varchar(1) default 'F';
alter yourtable alter is_deleted type d_is_delete;

Otherwise, locate the RDB$NN implicit domain that your field is_deleted use:

select rdb$field_source from rdb$relation_fields
where rdb$field_name = 'IS_DELETED'
and rdb$relation_name = <yourtable>;
=> this gives a <dom_name> as the result

then use
alter domain <dom_name> set default 'F';

I think we need to make this facility available without tricks, directly in
alter tbl alter col set default <something>;
alter tbl alter col drop default;
Sean, would you log this feature request? Thank you.

Claudio Valderrama C. - -
Independent developer
Owner of the Interbase® WebRing