MySQL Forums
Forum List  »  Connector/Node.js

insert a tag element in longtext field used as XML
Posted by: anmol agarwal
Date: June 26, 2010 11:40AM

hey,

i have created a table called book_table

mysql> describe book_table;
+-----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+----------------+
| bookid | int(15) | NO | PRI | NULL | auto_increment |
| book_type | varchar(15) | NO | | NULL | |
| title | varchar(100) | NO | | NULL | |
| author | varchar(70) | NO | | NULL | |
| type | varchar(15) | NO | | NULL | |
| competency | varchar(40) | NO | | NULL | |
| upload_link | varchar(200) | YES | | NULL | |
| owner | varchar(40) | NO | | NULL | |
| status | varchar(20) | NO | | NULL | |
| sl | varchar(40) | YES | | NULL | |
| is_reissued | varchar(3) | YES | | NULL | |
| issued_to_users | longtext | NO | | NULL | |
| review | longtext | NO | | NULL | |
| details | longtext | NO | | NULL | |
+-----------------+--------------+------+-----+---------+----------------+


suppose for a perticular tuple the value in review field is as follows:


<reviews><user><user_name>321654</user_name><review>This is a nice book.</review></user></reviews>


but for one book there can be many reviews from different user.

so i want to insert one more tag at the end of the exiting user tag. It should look something like this.

<reviews><user><user_name>321654</user_name><review>This is a nice book.</review></user><user><user_name>654321</user_name><review>I didnt like this book.</review></user></reviews>

please can anybody tell me how to do this from a jsp page.
i will be very grateful. thankyou.

Options: ReplyQuote


Subject
Written By
Posted
insert a tag element in longtext field used as XML
June 26, 2010 11:40AM


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.