Integration

Get Involved. Join the Conversation.

Topic

    Cesar Tepetla Corte
    Compare if a Select query returns data.Answered
    Topic posted June 5, 2019 by Cesar Tepetla CorteBronze Medal: 1,250+ Points, tagged API, Connection, Database, Events, Integration, Mapping, xml 
    50 Views, 3 Comments
    Title:
    Compare if a Select query returns data.
    Summary:
    Compare if a Select query returns data.
    Content:

    Hi everyoe,

    I am working on an integration where I must evaluate a condition, first I need to do an operation 'select * from ...'
    if the query does not return records then I must send a notification that says no records were found but otherwise the table returns data I must send another notification that says there is data to process.

    I tried to make the comparison taking the collection created after making the query as shown in the attached image but it does not work.

    Any comment is grateful.

    Image:

    Best Comment

    Jorge Herreria

    Cesar

    In orchestration expressions and Mappings use XPath Expressions language. Arguably there is not "null" concept in XPath Expressions.

    Use the "count()" function to count the number of nodes, then compare it to Zero

    Comment

     

    • Jorge Herreria

      Cesar

      In orchestration expressions and Mappings use XPath Expressions language. Arguably there is not "null" concept in XPath Expressions.

      Use the "count()" function to count the number of nodes, then compare it to Zero

    • Cesar Tepetla Corte

      Hi Jorge,

      you are absolutely right, I modified my function according to what you said and it worked:
      count ($ CheckFilesWithErrors / nsmpr2: FilesErrorsCollection / nsmpr2: FilesErrors / nsmpr2: fileName) = "0"

      Thank you.