No such thing as a small change | |
PerlMonks |
Re: "undef" is not NULL and what to do about itby Tux (Canon) |
on Feb 20, 2013 at 17:49 UTC ( [id://1019814]=note: print w/replies, xml ) | Need Help?? |
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. Enjoy, Have FUN! H.Merijn
In Section
Meditations
|
|