MySQL Forums
Forum List  »  Connector/Node.js

Separating return values.
Posted by: Tommi Pisto
Date: March 11, 2006 10:37AM

In the documentation there was following example about ExtractValue.

-- clip --

mysql> SELECT
-> ExtractValue('<a>ccc<b>ddd</b></a>', '/a') AS val1,
-> ExtractValue('<a>ccc<b>ddd</b></a>', '/a/b') AS val2,
-> ExtractValue('<a>ccc<b>ddd</b></a>', '//b') AS val3,
-> ExtractValue('<a>ccc<b>ddd</b></a>', '/b') AS val4,
-> ExtractValue('<a>ccc<b>ddd</b><b>eee</b></a>', '//b') AS val5;

+------+------+------+------+---------+
| val1 | val2 | val3 | val4 | val5 |
+------+------+------+------+---------+
| ccc | ddd | ddd | | ddd eee |
+------+------+------+------+---------+

-- clap --

So, in the last example (val5) two values were returned and those were separated using space character. What if one of those two values contains also space chracters. Is it impossible then to figure out how many hits there were?

Example:

Two values in A tags

ExtractValue('<A>Value 1 </A><A>Value 2 </A>', '//A') AS val1;

+-----------------+
| val1 |
+-----------------+
| Value 1 Value 2 |
+-----------------+

Now one would separate Value 1 and 2 from the result. How is that possible?

Best regards, Tommi

Options: ReplyQuote


Subject
Written By
Posted
Separating return values.
March 11, 2006 10:37AM


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.