Subject Re: [firebird-support] Changing a default field value
Author Martijn Tonies
Hi,

> At 12:38 PM 19/08/2003 +1000, you wrote:
> >I have a DB table field with DEFAULT = 'T'. I want to change the default
> >value, but cannot using IBExpert or IBOConsole. Is there a way to do this
> >without pumping all the data into a new (fixed) table and renaming it?
>
> You don't have to pump the data into a new table. Just add a temporary
> column of the right type with no constraints, copy the current data to it
> (using an UPDATE statement), drop the original column, add it back again
> with the new default value and copy the data back. Then drop the temp
> column and you're there.
> NB.
> Update atable set tempcol = MyBooleanCol
> where MyBooleanCol is not null

That's one way. Another one is downloading yourself a trial
copy of Database Workbench, modifying the DEFAULT value
and clicking "Save". Yes, that's it :-)


With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com