Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MySQL (http://www.go4expert.com/forums/mysql-forum/)
-   -   Update query for XML tag values (http://www.go4expert.com/forums/update-query-xml-tag-values-t8181/)

Windhan 10Jan2008 10:58

Update query for XML tag values
 
Hi All,

My Mysql Version is 5.0,

I have XML in the table and i want to update a particular tag,

For Ex:
This is my XML,

<order>
<product>
<Item>
Crop
</Item>
.
.
.
.
.
.
<Item>
doe
</Item>
<product>
<order>

Now I update the Item Tag value alone as same product and i need the output as,

<order>
<product>
<Item>
myproduct
</Item>
.
.
.
.
.
.
<Item>
myproduct
</Item>
<product>
<order>

How can update like this?, as my Version does not support XML functions.

pradeep 10Jan2008 21:31

Re: Update query for XML tag values
 
You have to fetch the XML data, process it using a parser if required and the update the table with the new XML data. On-the-fly updation is not possible.

Windhan 11Jan2008 13:31

Re: Update query for XML tag values
 
Can't be this possible with a normal update query with MYSQL String Functions may be inside a Stored Procedure?

:thinking:

Windhan 11Jan2008 18:01

Re: Update query for XML tag values
 
If i get a solution for my requirement here....that will be great
:worried:

shabbir 11Jan2008 18:48

Re: Update query for XML tag values
 
MySQL does not provide SQL operations but string operation is there but I am not sure that can help unless you have a very good at regular expressions


All times are GMT +5.5. The time now is 03:06.