August 27, 2010 at 9:50 am
Hey Gurus and Grand Masters
I have xml stored in a column with data type = text. I need to update multiple substrings of data within that text column (ie update ‘<data>1</data>’ to ‘<data>Test</data>’, ‘<data>2</data>’ to ‘<data>Test2</data>’). In trying the Replace function, it returns this message: Argument data type text is invalid for argument 1 of replace function.
In light of this, I am using the updatetext function instead. Due to the column data type of text, this function requires a delete_lengthvalue in bytes. Right now I have string length, I am looking for the best way to calculate byte length. Is there a built-in function to do this? Multiplying by a factor seems to work in some cases but not all, I am still in the midst of testing this…
August 27, 2010 at 10:14 am
Change the text data type to XML. This is not only to match data type and data content. You'll also get rid of a deprecated data type.
Once this is done you can use XQuery to modify the xml data in your table. It'll be a lot easier (once you got used to it).
A good resource for XQuery is Jacob Sebastians blog.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy