in reply to Re^2: DBI: passing undef as an argument
in thread DBI: passing undef as an argument
SQL's use of "NULL" is inherently flawed as the relational model does not work with "NULL" values as implemented by SQL. Codd himself (in "The Relational Model for Database Management: Version 2) suggested that the SQL implementation of NULL was flawed and should be replaced by two distinct NULL-type markers. The markers he proposed were to stand for "Missing but Applicable" and "Missing but Inapplicable", known as A-values and I-values, respectively. Codd's recommendation, if accepted, would have required the implementation of a four-valued logic in SQL. None of the common RDBMs in use do this and neither does any SQL standard.
Of course, the SQL standard is a flawed implementation of the relational model in any case, but as it is "the best" (meaning the only one we have), we will have to live with it.
To give an example of how flawed the use of "NULL" is, consider the following:
I agree that "NULL" comes in handy in using as a placeholder for an unknown value, but in many cases the use of "NULL" indicates that we have not been thinking the design of our database through in all its aspects and that something should be changed there.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: DBI: passing undef as an argument
by ikegami (Patriarch) on Aug 12, 2009 at 14:52 UTC | |
by CountZero (Bishop) on Aug 12, 2009 at 19:51 UTC | |
|
Re^4: DBI: passing undef as an argument
by ruzam (Curate) on Aug 09, 2009 at 02:27 UTC | |
|
Re^4: DBI: passing undef as an argument
by dsheroh (Monsignor) on Aug 09, 2009 at 09:18 UTC | |
by CountZero (Bishop) on Aug 09, 2009 at 13:45 UTC | |
by dsheroh (Monsignor) on Aug 10, 2009 at 09:31 UTC | |
by CountZero (Bishop) on Aug 10, 2009 at 20:38 UTC | |
by ruzam (Curate) on Aug 11, 2009 at 02:57 UTC |