in reply to "undef" is not NULL and what to do about it
This is one of the reasons why we - in ALLL our database types - disallow NULL values. All fields should have (default) values.
Also try to think about what will become of data when exported as CSV, which most modern databases support. CSV does not know the difference between 1,,2 and 1,"",2 (by default), so inserting exported data somewhere else might alter your data.
This is also one of the major reasons why I thoroughly hate Oracle. If I insert an empty string into a varchar field in Oracle, it helpfully inserts a NULL instead. HATE HATE HATE. Also see here.
I for one do not see perl's undef being wrong here, but the inconsistency in databases. OTOH I could see value in a new constant really being NULL.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: "undef" is not NULL and what to do about it
by nikosv (Deacon) on Feb 20, 2013 at 20:07 UTC | |
Re^2: "undef" is not NULL and what to do about it
by Rhandom (Curate) on Feb 21, 2013 at 15:47 UTC | |
Re^2: "undef" is not NULL and what to do about it
by morgon (Priest) on Feb 20, 2013 at 23:15 UTC | |
by runrig (Abbot) on Feb 21, 2013 at 00:06 UTC | |
by Tux (Canon) on Feb 21, 2013 at 06:58 UTC | |
Re^2: "undef" is not NULL and what to do about it
by herveus (Prior) on Feb 25, 2013 at 20:26 UTC |