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.

 View Only
Expand all | Collapse all

comparing 2 strings using XQuery in Tamino 4.1

  • 1.  comparing 2 strings using XQuery in Tamino 4.1

    Posted Tue April 22, 2003 01:08 AM

    Hi,

    We are currently storing documents in Tamino that have a field called “dateOfService” of type xs:string and with the following format: YYYYMMDD (ex: 20030421).

    I am looking to query for all documents that fall between some_starting_date and some_ending_date (both of which beeing of type xs:string and of the same format spcified above)

    1. Can I use the xs:date(string) function? It seems to parse date with YYYY-MM-DD formats only.
    2. Is the xf:compare(string, string) function implemented in Tamino 4.1?
    3. The operators (=, < and >) don’t seem to work with strings.
    4. I get a type exception when I do the following (probabily because some documents might have the dateOfService field blank)

    for $a in input()/doc:revisionDoc
    where xs:int($a/document/dateOfService) >= xs:int(20020101)
    return { $a/@id }

    Does anybody have some suggestions? Thank you for your help.

    Eric


    #webMethods
    #API-Management
    #Tamino


  • 2.  RE: comparing 2 strings using XQuery in Tamino 4.1

    Posted Tue April 22, 2003 02:23 PM

    If I have some documents such as :



    I can query for a specific date range using:

    for $x in input()/dates
    where $x/@date >= “20030410” and $x/@date <= “20030430”
    return $x

    To speed things up I can define a standard index on the date attribute.

    Hope this helps.

    Stuart Fyffe-Collins
    Software AG (UK) Ltd.


    #Tamino
    #API-Management
    #webMethods


  • 3.  RE: comparing 2 strings using XQuery in Tamino 4.1

    Posted Fri April 25, 2003 09:27 PM

    yes this helps thank you


    #API-Management
    #webMethods
    #Tamino