Re: Indexes on XML tags?
Yes, the returned value will be extracted as text,
but as MySQL is not strict about data types, the above should work.
However, in some cases it's really usefull to return a value
as a number, instead of text. You can use "number()" XPath type-cast
to return a value as a number.
These two queries demonstrate the difference:
mysql> select ExtractValue('<num>01</num>','/num');
+--------------------------------------+
| ExtractValue('<num>01</num>','/num') |
+--------------------------------------+
| 01 |
+--------------------------------------+
1 row in set (0.00 sec)
mysql> select ExtractValue('<num>01</num>','number(/num)');
+----------------------------------------------+
| ExtractValue('<num>01</num>','number(/num)') |
+----------------------------------------------+
| 1 |
+----------------------------------------------+
1 row in set (0.01 sec)
Subject
Written By
Posted
Re: Indexes on XML tags?
December 01, 2006 04:03AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.