roxen.lists.roxen.general

Subject Author Date
sql_null in Roxen 5.0 Stephen R. van den Berg <srb[at]cuci[dot]nl> 18-08-2008
From Roxen 5.0:
      // Change in >= 5.0: Don't abuse RXML.nil for SQL NULL. RXML.nil
      // means UNDEFINED in this context, i.e. that the variable
      // doesn't exist at all. An SQL NULL otoh is just a special
      // value in an existing variable, at least on the RXML level.

Pike 7.8 returns Pike UNDEFINED objects in Sql.Sql queries for columns
that return NULL values (as opposed to integer zero); Pike <7.8 returned
integer zeros.

In RXML I'd gotten accustomed to make use of the fact that a certain
RXML variable didn't exist in the result when its SQL-columnvalue returns
NULL.

Now, with this new sql_null object, things get a bit messy.
How am I supposed to distinguish a zero value from a NULL inside RXML
now?

What's wrong with simply setting the RXML variable to Pike UNDEFINED
as well (in case of a NULL value)?
It is backwards compatible, and I don't see any implied uncorrectness?
Am I missing something?
-- 
Sincerely,
           Stephen R. van den Berg.
"If you make people think they're thinking, they'll love you;
 but if you really make them think, they'll hate you."