IT Process Automation

  • 1.  How do I use a < in a where clause?

    Posted May 26, 2015 06:18 PM

    Hi, I have a issue with a process that updates tickets in CA SDM.  I'm trying to add another condition in the where clause of a doSelect operator to test against a date, for example resolve_date < 1432000080.

     

    Here is the syntax for the variable which is then passed as the where clause dynamic parameter:

     

    Process.SDM_WhereClause = "status = 'RE' AND resolve_date < " + Process.CheckDate

     

    Which doesn't work, however the following does work:

     

    Process.SDM_WhereClause = "status = 'RE' AND resolve_date = " + Process.CheckDate

     

    I think the < needs escaping somehow so its not misinterpreted as being part of a tag.  The Unicenter Service Desk Web Services User Guide does say that a < is a valid comparison operator for a where clause.

     

    Any suggestions welcome



  • 2.  Re: How do I use a < in a where clause?
    Best Answer

    Posted May 27, 2015 03:26 AM

    Hi.

    Just try using "&lt;" for "<", and "&gt;" for ">".

    Kind regards

    ...........Michael



  • 3.  Re: How do I use a < in a where clause?

    Posted May 27, 2015 08:39 PM

    Excellent, this worked perfectly, thanks



  • 4.  Re: How do I use a < in a where clause?

    Posted May 27, 2015 08:02 AM

    I think part of your difficulty maybe that you need to enclose the entire where clause in quotes, another possibility maybe enclosing the variable within double quotes?

    Below is a working where clause from a doSelect operator.

     

    "zParChInd = 'Child' and parent is NULL and open_date > "+Process.FirstOpenDate+""