Subject Re: [firebird-support] Re: Avoiding Null value and having basic default values
Author Martijn Tonies
Hi,

> >2) you can easily change the behaviour in a BEFORE INSERT or UPDATE
> >trigger:
> >
> >if (new.mycolumn is null) then new.mycolumn = 0;
>
> That would be tedious, specifying each and every one of the fields. Any
> one stop shop <g>. I need each and every one initialized to it's
> characteristic default value.

Well, a DEFAULT clause is only honored if you don't specify
the column in the INSERT INTO clause.

So, if it does get inserted, but with a value of NULL, then
the only thing you can do is writing triggers.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com