Subject | Re: SV: [firebird-support] Best Practice re null |
---|---|
Author | Milan Babuskov |
Post date | 2011-11-07T09:55:31Z |
homerjones1941 wrote:
default is only used if column is not specified in INSERT. If you run
insert into t1 (field1, field2) values ('abc', NULL);
You would still have NULL in the field. Therefore, it might be best to
use COALESCE even if you have default set.
HTH
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================
> I think I will implement the "Default" solutionThere would be no problem, and it is not overkill. Please note that
> Would there be a problem in using Coalesce(...) in addition to setting the default values? I can't think of any, other than it may be overkill.
default is only used if column is not specified in INSERT. If you run
insert into t1 (field1, field2) values ('abc', NULL);
You would still have NULL in the field. Therefore, it might be best to
use COALESCE even if you have default set.
HTH
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================