Subject | Re: [firebird-support] Alter Colum to set a Default Value |
---|---|
Author | Marius Labuschagne |
Post date | 2010-06-03T07:47:53Z |
Hi Martijn,
Thanks for the response. I am a long time (2003) user of your product,
and know you can do it the DBW itself.
I need to change it from script though, there are about 300 different
Clients using our system, so it needs to be automated with our next
release (from code)
All my Clients are running Firebird 2.1.3.
Regards
Marius
Thanks for the response. I am a long time (2003) user of your product,
and know you can do it the DBW itself.
I need to change it from script though, there are about 300 different
Clients using our system, so it needs to be automated with our next
release (from code)
All my Clients are running Firebird 2.1.3.
Regards
Marius
On 03/06/2010 08:49, Martijn Tonies wrote:
>
> Hello Marius,
>
> > Is it possible to issue a statement to change or set the default value
> > for an existing column?
> >
> > I have tried the following:
> > alter table stock alter column StockType type varchar(20) default
> > 'Non-Serialised';
> >
> > But this does not work, it produces an error:
> > Invalid token.
> > Dynamic SQL Error.
> > SQL error code = -104.
> > Token unknown - line 1, column 59.
> > default.
>
> It depends on the version of Firebird, I believe 2.1 or 2.5 supports this.
>
> > 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.
> >
> > Any help appreciated.
>
> Download Database Workbench from www.upscene.com - it can add
> a default value to existing table columns.
>
> With regards,
>
> Martijn Tonies
> Upscene Productions
> http://www.upscene.com
>
> Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
> Anywhere, MySQL, InterBase, NexusDB and Firebird!
>
>
>
>
[Non-text portions of this message have been removed]