NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
NULLs (Score:2)
I haven't got to his criticism of
I've been meaning to blog this for a while, but what the hell, might as well just say it here.—theoryNULLs in the book, yet, but I have my own ideas about why they suck. First of all, aNULLis supposed to mean "unknown." The problem comes when you need to represent "known, but empty." This is fine for character fields, where you can set an empty string (Larry calls it a "null string"), and it not null but has no real value, either. But how do you do that for, say, integers? For dates? You could use 0 for integer, but that's an actual value. You could use '0000-00-00T00:00:00' for the date, but that's an actual date (Happy Birthday, Jesus!). So what do you use for "the value is not unknown, it's intentionally left blank"? SQL gives you no way to do that.Reply to This
Re:NULLs (Score:2)
I just finished reading how to handle missing info without nulls [onetel.com]. It looks really long, but there's a goof up in the PDF and the slides have been duplicated. The actual talk is very short and then there's a step-by-step walkthrough of the D-like query they use to get the answer.
One potentially unsatisfactory approch is to use an extra column to denote the type of null information of another column.
Re:NULLs (Score:1)
Re:NULLs (Score:2)
A transaction may contain many atomic operations and becomes, itself, an atomic operation. However, the database itself may be in an inconsistent state during a transaction. The relational theory outlined by Date requires that no atomic operations allow the database to be in an inconsistent state. For example, let's say you have an employee relation (table) and salary values are moved into separate tables defining them as either "unknown" or "unemployed" (for previously null values) or "salary_amount" fo