[Home] [By Thread] [By Date] [Recent Entries]
At 18:21 -0500 12/2/03, Ben Trafford wrote:
Just a wee heads-up for anybody using MySQL's XML output function...it seems to export any empty field with a datatype of "text" as an empty element, rather than an element containing the NULL one might expect.
I issued these statements using mysql -X: DROP TABLE IF EXISTS t;
CREATE TABLE t (tx TEXT);
INSERT INTO t (tx) VALUES(''),(NULL),('some text');
SELECT tx FROM t;The result was: <?xml version="1.0"?> <resultset statement="SELECT tx FROM t">
<row>
<tx></tx>
</row> <row>
<tx>NULL</tx>
</row> <row>
<tx>some text</tx>
</row>
</resultset>Dumping the table with mysqldump -X produces: <?xml version="1.0"?>
<mysqldump>
<database name="test">
<table name="t">
<row>
<field name="tx"></field>
</row>
<row>
<field name="tx">NULL</field>
</row>
<row>
<field name="tx">some text</field>
</row>
</table>
</database>
</mysqldump>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



