Skip to main content
Solved

In Operator in a Tester What is the Syntax?


Hello,

I am trying to use the In operator in the Tester on a comma separated list of strings.

In ArcMAP Select by Attributes, I would do this:

SELECT * FROM <tablename> WHERE:

<attribute name> in ('00002','00003', etc...)

When I try this syntax with the Tester, I am getting this error:

2018-05-07 16:23:01| 12.7| 0.0|ERROR |Tester(TestFactory): An error was encountered evaluating a TestFactory test: Illegal operator `IN' supplied for test evaluation -- operator must be one of < > <= >= != = ==

2018-05-07 16:23:01| 12.7| 0.0|ERROR |An error was encountered evaluating a TestFactory test: Illegal operator `IN' supplied for test evaluation -- operator must be one of < > <= >= != = ==

I know that I can limit the values returned by using SQL in the reader, but this method would be preferred.

I have tried/tested changing the mode, removing the ( brackets, putting the values in line. No luck.

Does the In operator work with the tester?

Thanks for your help.

Best answer by lars_de_vries

Usually the 'IN' operator in the Tester works as a inline list, seperated by comma's. You can use double quotes if a value contains a comma or a space. Like:

Value1,Value2,Value3,"Value 4",Value5 
View original
Did this help you find an answer to your question?

3 replies

mark2atsafe
Safer
Forum|alt.badge.img+44

It should work fine (though I'm running an intensive workspace right now so can't test for myself). The left hand side is usually the attribute to test. The middle part is the operator (In), and the right hand side should be a comma-delimited list of values.

You don't necessarily need quote characters around the values, but if you do I notice that that the help shows double quotes (") and not single ones (') so maybe that is a problem.

Otherwise, can you add a screenshot of how your Tester parameters dialog looks? That might help us to diagnose the issue.


lars_de_vries
Forum|alt.badge.img+10

Usually the 'IN' operator in the Tester works as a inline list, seperated by comma's. You can use double quotes if a value contains a comma or a space. Like:

Value1,Value2,Value3,"Value 4",Value5 

  • Author
  • May 8, 2018

Thanks for the help!

This one was driving me nuts.

The solution (for me) is to have the values inline, without spaces between values. I was getting caught by having trailing spaces after the comma.

Ex: '00002','00003','00514'....

Tip for transposing list of values to inline: https://superuser.com/questions/598241/transpose-column-to-row

NotePad++

  1. Ctrl + A
    : selects all.
  2. Ctrl + J
    : aligns them in a row.
  3. Use find/replace to replace the spaces with no spaces (hit space in the Find field, make sure nothing is in the replace field)

For posterity: 

  • Reader is Oracle Non-spatial. 
  • Field being tested is VARCHAR2 (5 CHAR) (ESRI reads this as a String)
  • Tester Parameters:

     

    0684Q00000ArLXrQAN.png


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings