Subject Re: [firebird-support] alter table syntax
Author Martijn Tonies
Hi,

> I'm want to alter a column from 'NOT NULL' to 'NULL', it doesn't need
> to be 'NOT NULL' it's not part of any constraints. I'm having a hard
> time with the syntax, or is it even possible?
>
> I've tried many things, ie:
> alter table stmenu
> alter column name varchar(40) null
>
> but keep getting:
> Token unknown - line 2, char 21
> varchar
>
> the SQL ref is not helping me much here, it's not clear if I can even
> do this, but I hate to loose all the data.

well, it's pretty clear - you cannot do this. :-)

In order to do that, you need to drop a constraint and set the
RDB$NULL_FLAG column.

An easier way is to download yourself a trial of Database Workbench
( www.upscene.com ) - start the Table Editor and uncheck the "not
null" box, then press "Save".


With regards,

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