IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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.


#TechXchangePresenter
 View Only
  • 1.  max. Value and sort by

    Posted Wed August 23, 2006 05:13 PM

    Hello,
    i assumed to get the max.systemId of total systems. So i sort the systemId descending and the first one has the max. systemId. Who has a better idea to get the max. value with xquery?

    Furthermore, i’v got an error message with sorting like this:
    variable undefined; varable q
    -----here is my xquery

    for $q in input()/system 
    sort by($q/key/systemId descending)
    return $q/key/systemId

    any suggestion is welcome,

    Chacha


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: max. Value and sort by

    Posted Wed August 23, 2006 07:28 PM

    XQuery has a “max” function. see “xqueryref/ref-fn_max.htm#ref-fn_max” in your Tamino documentation tree.


    #API-Management
    #webMethods
    #Tamino


  • 3.  RE: max. Value and sort by

    Posted Mon August 28, 2006 11:58 AM

    indeed,the max function is fine.

    Thanks a lot.

    But regard to the problem with sort by (see the previous message), i don’t know, why i didn’t get the sorted list.


    #webMethods
    #API-Management
    #Tamino


  • 4.  RE: max. Value and sort by

    Posted Mon August 28, 2006 01:53 PM

    Hi,
    i have solved this problem by myself.
    The correct query seems like this:

    for $q in input()/system
    return $q/key/systemId
    sort by(. descending)

    or

    for $q in input()/system
    sort by(./key/systemId descending)
    return $q/key/systemId

    Chacha


    #Tamino
    #webMethods
    #API-Management