Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8986483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:33:40+00:00 2026-06-15T21:33:40+00:00

I have below table structure ID int xmlData xml I want data in the

  • 0

I have below table structure

ID int

xmlData xml

I want data in the xml column (xmlData) to updated with new value based on below condition. Below is the sample data in xml column.

<customer>
  <name display="CName">abc</name>
  <customerId display="CID">123</customerId>
</customer>

some rows in my table may not have customerId xml tag , i want to identity those and need to update the xml tag with customerId

Please suggest , how i can do this.

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:33:41+00:00Added an answer on June 15, 2026 at 9:33 pm

    Use modify() Method (xml Data Type) with insert (XML DML).

    update YourTable
    set xmlData.modify('insert <customerId display="CID">123</customerId> 
                        into customer[1]')
    where xmlData.exist('/customer/customerId') = 0
    

    Use exist() Method (xml Data Type) in the where clause so you only update the rows that does not have a customerId node.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
I have a table structure having a EMP_DATE column as below ID EMP_DATE ----
I have following table structure there is column vid in that i want entry
I have a mysql database with a table structure like below : Table Name
I have a table with below structure. I am not having control over changing
I have two table masterTbl and detailTbl which structure is given below... --PRIMARY TABLE
I have the below table. I am trying to get tbody column bgcolors matching
I have a Generic List object which hold below table as its own value.
Below I have table - Company id name value year 1 IBM 10 2011
I have a table T (structure below) which initially contains all-NULL values in an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.