dbTalk Databases Forums  

xml update

microsoft.public.sqlserver.xml microsoft.public.sqlserver.xml


Discuss xml update in the microsoft.public.sqlserver.xml forum.



Reply
 
Thread Tools Display Modes
  #31  
Old   
Martin Honnen
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 11:15 AM






Roy wrote:
Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'
How does the current content of that 'myelement' look, does it contain
child elements?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #32  
Old   
Martin Honnen
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 11:15 AM






Roy wrote:
Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'
How does the current content of that 'myelement' look, does it contain
child elements?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #33  
Old   
Martin Honnen
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 11:15 AM



Roy wrote:
Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'
How does the current content of that 'myelement' look, does it contain
child elements?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #34  
Old   
Martin Honnen
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 11:15 AM



Roy wrote:
Quote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'
How does the current content of that 'myelement' look, does it contain
child elements?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #35  
Old   
Roy
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 11:48 AM



myelement is an xml element with datetime type. So it looks like
<myelement>2008-05-21T09:50:56.531Z</myelement>

"Martin Honnen" wrote:

Quote:
Roy wrote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

How does the current content of that 'myelement' look, does it contain
child elements?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #36  
Old   
Roy
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 11:48 AM



myelement is an xml element with datetime type. So it looks like
<myelement>2008-05-21T09:50:56.531Z</myelement>

"Martin Honnen" wrote:

Quote:
Roy wrote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

How does the current content of that 'myelement' look, does it contain
child elements?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #37  
Old   
Roy
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 11:48 AM



myelement is an xml element with datetime type. So it looks like
<myelement>2008-05-21T09:50:56.531Z</myelement>

"Martin Honnen" wrote:

Quote:
Roy wrote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

How does the current content of that 'myelement' look, does it contain
child elements?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #38  
Old   
Roy
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 11:48 AM



myelement is an xml element with datetime type. So it looks like
<myelement>2008-05-21T09:50:56.531Z</myelement>

"Martin Honnen" wrote:

Quote:
Roy wrote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

How does the current content of that 'myelement' look, does it contain
child elements?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #39  
Old   
Roy
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 11:48 AM



myelement is an xml element with datetime type. So it looks like
<myelement>2008-05-21T09:50:56.531Z</myelement>

"Martin Honnen" wrote:

Quote:
Roy wrote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

How does the current content of that 'myelement' look, does it contain
child elements?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
  #40  
Old   
Roy
 
Posts: n/a

Default Re: xml update - 05-21-2008 , 11:48 AM



myelement is an xml element with datetime type. So it looks like
<myelement>2008-05-21T09:50:56.531Z</myelement>

"Martin Honnen" wrote:

Quote:
Roy wrote:
I have id and xml columns in mytable. I want to update an element called
myelement with the following

UPDATE MyTable SET
xml.modify
('replace value of
(/root/child/grandchild/myelement)[1] with
xs:dateTime("2002-05-30T09:30:10Z")')
WHERE id = '00000000-0000-0000-0000-000000000000'

But I got
XQuery [mytable.xml.modify()]: The target of 'replace value of' must be a
non-metadata attribute or an element with simple typed content, found
'element(myelement,xdt:untyped) ?'

How does the current content of that 'myelement' look, does it contain
child elements?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.