OK, there we go :-) there is no such thing as a NULL numeric, or a NULL string, or a NULL date -- and also, NULL is *not* the same as empty. NULL is a marker to indicate the absence of an attribute value. So NULL represents "missing". that's why the two-valued logic is not good enough anymore; we need three-valued logic. if you look at the substr function, it returns a string, right? by decrementing one of the arguments, the result gets shorter and shorter -- until the last character is taken away. the result is *still* a string, and as such a value, in my opinion. or, to give you another example, what should be the result of instr(s,s) where s represents a string? 1 (one), right? I would argue that this should also be the case if s is the empty string. By the way, the ISO/ANSI standard thinks along the same lines, and as such Oracle is *not* compliant with the ANSI/ISO SQL standard in handling empty strings. cheers, Lex. > Lex de Haan [mailto:lex.de.haan@xxxxxxxxxxxxxx] wrote: > >> well, I don't want to start a religious thread here, but I think it > is a >> problem that Oracle treats empty strings as nulls. an empty string > is a >> string, allbeit a short one (just like an empty set is a set, though > a >> small one) and thus has a datatype. a null is a marker, not a value, > and >> has no datatype. therefore, there is (or should be) an important >> difference between empty strings and nulls. > > Lex, then why is a NULL numeric not confusing then? > > Can you get an "empty" numeric variable? No! It is a null variable. > > Why treat a string variable differently then? > > A numeric variable either has a value (-1, 0 or billions). Or not. > When it does not have a value it is considered a NULL. > > A string variable is no different. There is no such thing as an > "empty" string. Just as there is not such thing as an "empty" numeric, > or an "empty" date, or an "empty" bool, or an "empty" pointer, or an > "empty" <insert your favouriote datatype here>. It is either NULL or > it has a value. AS SIMPLE AS THAT!! > > So why treat string variables differently than all other data types!? > Magically we now have "empty" strings despite the fact that an "empty" > variable in ALL other data types are considered null. Does not > compute. > > Nothing religious about it. Unless common sense and logic are > considered a religion? > > -- > Billy > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > This e-mail and its contents are subject to the Telkom SA Limited > e-mail legal notice available at > http://www.telkom.co.za/TelkomEMailLegalNotice.PDF > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > -- > //www.freelists.org/webpage/oracle-l > -- //www.freelists.org/webpage/oracle-l