Clarity Service Management

Expand all | Collapse all

Web Service - Using NOT IN in whereClause

Jump to Best Answer
  • 1.  Web Service - Using NOT IN in whereClause

    Posted 04-11-2018 09:05 AM

    Hello everyone, I'm trying to use the NOT IN statement in a whereClause, but it returns:

     

    <ErrorMessage>Error fetching: AHD03053:Bad where clause: Parse error at : "object_id NOT IN('903608', '903558', '903373', '903240', '903206', '902742', '902287', '901541', '901471', '901275',
    ^ '900814', '900865', '900398', '900267', '900135', '900031', '900088', '900021'..." (syntax error)</ErrorMessage>
    <ErrorCode>103</ErrorCode>

     

    here is my whereClause 

    <objectType>cr</objectType>

    <whereClause>id NOT IN ('903608', '903558', '903373', '903240', '903206', '902742', '902287', '901541', '901471', '901275', '900814', '900865', '900398', '900267', '900135', '900031', '900088', '900021', '900107', '899670', '899053', '899049', '899046', '898892', '898885', '898795', '898679', '898602', '897774', '897708', '897534', '897615', '897613', '897611', '897606', '897598', '897482', '897476', '897472', '897240', '897357', '897195', '896983', '897004', '897001', '896886', '896911', '896633', '896614', '896477', '896283', '896322', '896256', '896149', '896127', '896103', '895843', '895765', '895492', '895481', '895561', '895416', '894815', '894606', '894540', '894518', '894517', '893642', '893776', '892708', '892654', '892423', '892494', '891976', '891842', '891784', '891803', '891324', '891387', '891322', '891321', '891250', '891248', '891137', '890786', '890675', '890672', '890620', '890329', '890286', '890284', '890143', '889878', '889395', '889353', '889350', '889171', '889011')</whereClause>

     

    Someone knows how to use NOT IN statement in WS?



  • 2.  Re: Web Service - Using NOT IN in whereClause

    Posted 04-11-2018 09:14 AM

    As I remember You can not use NOT IN statement in search, as well it is not possible to use it in WS call



  • 3.  Re: Web Service - Using NOT IN in whereClause

    Posted 04-11-2018 09:17 AM

    Do you know some query to use something like that on a WS call?



  • 4.  Re: Web Service - Using NOT IN in whereClause

    Posted 04-11-2018 09:20 AM

    Maybe those tickets have something in common. Why do you try to filter them? 



  • 5.  Re: Web Service - Using NOT IN in whereClause
    Best Answer

    Posted 04-11-2018 09:34 AM

    Well doing some tests I fix it doing this:

     

    NOT object_id IN ('903608', '903558', '903373', '903240', '903206', '902742', '902287', '901541', '901471', '901275',
    '900814', '900865', '900398', '900267', '900135', '900031', '900088', '900021', '900107', '899670', '899053', '899049',
    '899046', '898892', '898885', '898795', '898679', '898602', '897774', '897708', '897534', '897615', '897613', '897611',
    '897606', '897598', '897482', '897476', '897472', '897240', '897357', '897195', '896983', '897004', '897001', '896886',
    '896911', '896633', '896614', '896477', '896283', '896322', '896256', '896149', '896127', '896103', '895843', '895765',
    '895492', '895481', '895561', '895416', '894815', '894606', '894540', '894518', '894517', '893642', '893776', '892708',
    '892654', '892423', '892494', '891976', '891842', '891784', '891803', '891324', '891387', '891322', '891321', '891250',
    '891248', '891137', '890786', '890675', '890672', '890620', '890329', '890286', '890284', '890143', '889878', '889395',
    '889353', '889350', '889171', '889011')

     

    Thanks dude!