webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  xquery update with join

    Posted Thu February 23, 2006 03:01 PM

    Hi all,
    please could you help me write this xquery correctly? I don’t understand what’s wrong in it:

    for $a in distinct-values(input()/List//@key)
    let $b := count(for $aa in input()/List where $aa/@key= $a return $aa)
    let $c := count(for $aa in input()/List where $aa/@key= $a and $aa/@available=“True” return $aa)
    update for $z in collection(Index)/Index
    let $x := $z/@total
    let $y := $z/@partial
    where $z/@id=$a
    do ( replace $x with attribute total {$b}
    replace $y with attribute partial{$c})

    Thanks in advance,

    Pam


    #API-Management
    #webMethods
    #Tamino


  • 2.  RE: xquery update with join

    Posted Thu February 23, 2006 03:26 PM

    Hi,

    the correct syntax is

    
    update 
    for $a in distinct-values(input()/List//@key) 
    let $b := count(for $aa in input()/List where $aa/@key= $a return $aa) 
    let $c := count(for $aa in input()/List where $aa/@key= $a and $aa/@available="True" return $aa) 
    for $z in collection("Index")/Index 
    let $x := $z/@total 
    let $y := $z/@partial where $z/@id=$a 
    do ( replace $x with attribute total {$b} replace $y with attribute partial{$c}) 

    I did not check whether the query does what you expect

    Regards

    Harald


    #Tamino
    #webMethods
    #API-Management


  • 3.  RE: xquery update with join

    Posted Thu February 23, 2006 04:15 PM

    No! Interactive Interface response is:

    <ino:message ino:returnvalue=“6360”>
    <ino:messagetext ino:code=“INOXQE6360”>Unbound path not allowed here</ino:messagetext>
    ino:messagelineLine 5, column 22: </ino:messageline>
    </ino:message>

    Why?


    #API-Management
    #webMethods
    #Tamino


  • 4.  RE: xquery update with join

    Posted Thu February 23, 2006 04:34 PM

    Excuse me! It runs correctly!
    Thank you very much!


    #API-Management
    #Tamino
    #webMethods