Subject | RE: [firebird-support] Default Value not working |
---|---|
Author | Helen Borrie |
Post date | 2004-03-22T07:38:16Z |
At 11:10 PM 21/03/2004 -0800, you wrote:
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.
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
>Isn't this one of the silliest things? Why in the world would a defaultNeeeaah, dat's da way a default works. It kicks in if (and only if) the
>value not work.
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 statementTurn your thinking around to the way we use null in searches and so on. It
>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 :-)
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