|
From: rna020 <tom...@fr...> - 2008-06-16 14:58:28
|
Donal, ... snip ... > > The real use case here (so far as I can see) is sparse sequences, as > they are (an approximation of) what the result row from an SQL query > is[*]. Myself, I'd much rather use the empty string (or some other > nominated value) in those positions and then be able to query the result > set for which are actually NULL and which aren't (when I care at all). > But this is a solution that's only suitable for SQL results; the effort > seems to be all spent on trying to create general solutions so this > whole thing (EIAS->EIASXN) but that's an option that leaves many in the > TCT completely cold. > ... snip ... Extending the example a bit.... Suppose you have two tables A and X ... SELECT * FROM A ; +----+----+----+ | P | A | B | +----+----+----+ | P1 | A1 | B1 | | P2 | A2 | B2 | | P3 | A3 | B3 | | P4 | A4 | B4 | +----+----+----+ SELECT * FROM X ; +----+----+----+ | P | X | Y | +----+----+----+ | P1 | X1 | Y1 | | P2 | X2 | Y2 | | P5 | X3 | Y3 | | P6 | X4 | Y4 | +----+----+----+ The do a left join... SELECT * FROM A LEFT JOIN X ON A.P=X.P ; +----+----+----+------+------+------+ | P | A | B | P | X | Y | +----+----+----+------+------+------+ | P1 | A1 | B1 | P1 | X1 | Y1 | | P2 | A2 | B2 | P2 | X2 | Y2 | | P3 | A3 | B3 | NULL | NULL | NULL | | P4 | A4 | B4 | NULL | NULL | NULL | +----+----+----+------+------+------+ The 'NULL' in this case aren't values, they are "missing" values. This can be handled by the simple suggestions being proposed by the "no NULL in tcl" side of the discussion. What isn't clear, at least to me, is weather these ideas scale to more complicated cases in SQL and other situations like holes in lists. There are people that understand tcl a lot better then I do that are saying "no NULL in tcl" however when you're as simple as I am its not obvious how to deal with NULL data when you don't have a NULL representation in the language. Perhaps someone with a better understanding of the issues could write a "NULL values" document that could be added to the tcl document set. This would documentation could then be used as a guide for those less knowledge about the the theory and design of Tcl when dealing with NULL's. Tom K. |