Subject | Re: [firebird-support] Best Practice re null |
---|---|
Author | Kjell Rilbe |
Post date | 2011-11-07T21:10:47Z |
Den 2011-11-07 10:55 skrev Milan Babuskov såhär:
Might be nice to force all blanks to be '' rather than null.
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
> homerjones1941 wrote:Or also specify not null for that column?
> > I think I will implement the "Default" solution
> > 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.
>
> There would be no problem, and it is not overkill. Please note that
> 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.
Might be nice to force all blanks to be '' rather than null.
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64