Subject | Re: [firebird-support] Alter Colum to set a Default Value |
---|---|
Author | Martijn Tonies |
Post date | 2010-06-03T06:49:34Z |
Hello Marius,
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!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com
> Is it possible to issue a statement to change or set the default valueIt depends on the version of Firebird, I believe 2.1 or 2.5 supports this.
> 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.
> The StockType field is already in the database table with a varchar(20)Download Database Workbench from www.upscene.com - it can add
> definition, I just need to add a default value for this field.
>
> Any help appreciated.
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!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com