Subject RE: [firebird-support] Default Value not working
Author Helen Borrie
At 11:10 PM 21/03/2004 -0800, you wrote:
>Isn't this one of the silliest things? Why in the world would a default
>value not work.

Neeeaah, dat's da way a default works. It kicks in if (and only if) the
insert statement ignores the defaulted column. If you *pass* a null to a
nullable column, how would the engine know that it wasn't intended?

If you want a default value to prevail when null is passes, you have no
option except to use a trigger. It's not at all silly.

>IMHO, it should not matter if your insert statement
>includes a field that is null. If the column is defined w/ a default value,
>the table should use it, otherwise don't define a default value. This
>produces a lot of extra code (before insert triggers) just to make sure of
>values. Ugh.
>This logic on this one has always baffled me. (which is easy to do these
>days :-)

Turn your thinking around to the way we use null in searches and so on. It
is very useful to be able to set a column to null, or to base a rule on the
state of a column. SQL includes specific predicators to allow us to do
this. So how much more silly is it to overrule that?

(Your attention to trimming replies will be rewarded with the customary
appreciation...)

^heLen