Update Query using XQuery

Discussion in 'XML' started by CK, Nov 27, 2006.

  1. CK

    CK Guest

    UPDATE Sales.DeliverySchedule
    SET DeliveryList.modify('declare namespace
    df=http://schemas.adventure-works.com/DeliverySchedule;
    replace value of (df:DeliveryList/df:Delivery/df:Address)[1]' with "7194
    Fourth St., Rockhampton"')
    WHERE Sales.DeliverySchedule.ScheduleID = 1

    This query gives me the following error
    XQuery [Sales.DeliverySchedule.DeliveryList.modify()]: Invalid source
    character 0x2019

    Any ideas? What am I doing wrong here? Thanks for any advice.
    TIA,
    ~CK
     
    CK, Nov 27, 2006
    #1
    1. Advertising

  2. CK

    Guest

    Try this



    UPDATE Sales.DeliverySchedule
    SET DeliveryList.modify('declare default element namespace
    "http://schemas.adventure-works.com/DeliverySchedule";
    replace value of (DeliveryList/Delivery/Address[1]/text())[1] with
    "7194 Fourth St., Rockhampton"')
    WHERE Sales.DeliverySchedule.ScheduleID = 1
     
    , Nov 27, 2006
    #2
    1. Advertising

  3. CK

    CK Guest

    I tried it and I get the same error. Any other ideas?
    *****I just tried this and it works great!!!

    UPDATE Sales.DeliverySchedule
    SET DeliveryList.modify('declare default element namespace
    http://schemas.adventure-works.com/DeliverySchedule;
    replace value of (DeliveryList/Delivery/Address[1])[1] with "7194 Fourth
    St., Rockhampton"')
    WHERE ScheduleID = 1

    <> wrote in message
    news:...
    >
    > Try this
    >
    >
    >
    > UPDATE Sales.DeliverySchedule
    > SET DeliveryList.modify('declare default element namespace
    > "http://schemas.adventure-works.com/DeliverySchedule";
    > replace value of (DeliveryList/Delivery/Address[1]/text())[1] with
    > "7194 Fourth St., Rockhampton"')
    > WHERE Sales.DeliverySchedule.ScheduleID = 1
    >
     
    CK, Nov 27, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. FBS

    XQuery ( XML Query )

    FBS, Jun 8, 2005, in forum: XML
    Replies:
    1
    Views:
    518
    Martin Honnen
    Jun 8, 2005
  2. Replies:
    0
    Views:
    562
  3. Replies:
    0
    Views:
    419
  4. Mukesh
    Replies:
    2
    Views:
    926
    Walter Wang [MSFT]
    Jun 14, 2007
  5. RolfK
    Replies:
    1
    Views:
    1,626
    Martin Honnen
    Dec 20, 2008
Loading...

Share This Page