MySQL Forums
Forum List  »  Connector/Node.js

Re: Indexes on XML tags?
Posted by: Alexander Barkov
Date: December 01, 2006 04:03AM

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)

Options: ReplyQuote


Subject
Written By
Posted
cjb
April 18, 2006 04:50PM
June 02, 2006 10:57AM
July 05, 2006 11:04AM
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.