Author Topic: When searching using the OPBetween operator it throws the below exception  (Read 2101 times)

nishen

  • Newbie
  • *
  • Posts: 9
    • View Profile
Hello can some please assist if they have experienced the same situation:

Issue: When searching using the OPBetween operator it throws the below excpetion

ODException: com.ibm.edms.od.ODException: Invalid operator
   id = 0
  msg = Invalid operator
com.ibm.edms.od.ODException: Invalid operator
            at com.ibm.edms.od.ODCriteria.setOperator(ODCriteria.java:404)
            at com.dev.cmod.TcSearch.main(TcSearch.java:130)
            at com.dev.code.RestClient.<init>(RestClient.java:56)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)


We are receiving this when setting the search operators as per the link:
https://www.ibm.com/support/knowledgecenter/en/SSEPCD_9.5.0/com.ibm.ondemand.odwek.doc/dodwj018.htm


 System.out.println( "Setting operator to " + operator + "..." );
                    if ( operator.equals( "eq" ) )
                        opr = ODConstant.OPEqual;
                    else if ( operator.equals( "ne" ) )
                        opr = ODConstant.OPNotEqual;
                    else if ( operator.equals( "lt" ) )
                        opr = ODConstant.OPLessThan;
                    else if ( operator.equals( "le" ) )
                        opr = ODConstant.OPLessThanEqual;
                    else if ( operator.equals( "gt" ) )
                        opr = ODConstant.OPGreaterThan;
                    else if ( operator.equals( "ge" ) )
                        opr = ODConstant.OPGreaterThanEqual;
                    else if ( operator.equals( "in" ) )
                        opr = ODConstant.OPIn;
                    else if ( operator.equals( "ni" ) )
                        opr = ODConstant.OPNotIn;
                    else if ( operator.equals( "li" ) )
                        opr = ODConstant.OPLike;
                    else if ( operator.equals( "nl" ) )
                        opr = ODConstant.OPNotLike;
                    else if ( operator.equals( "be" ) )
                        opr = ODConstant.OPBetween;
                    else if ( operator.equals( "nb" ) )
                        opr = ODConstant.OPNotBetween;
                    else

                        opr = -1;

The between operator fails.

Thank you
Nishen

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2229
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Just a reminder to help us to help you -- providing information like platform, version numbers (and fixpacks!) of various software, etc. helps us narrow down the problem.  You can get 'bonus points' for providing a sample of the code that's causing problems and a brief description of what you're trying to accomplish.

Even though I'd not a Java programmer, my question is -- what's your use case for the 'not between' operator?  Maybe it's just early in the morning, but I can't picture a situation where you'd want to use it.

-JD.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

nishen

  • Newbie
  • *
  • Posts: 9
    • View Profile
Hi Justin

Noted, will keep that in mind for future posts.
Basically it was just the equal and the like operator which was working. For the not between case we use sometimes use to search in a date period but to exclude a certain period for example search for everything excluding results in 2017 so we will use not between 01/01/2017 and 31/12/2017.

We have managed to figure out the problem, we forgot to include on the folder configuration the valid operators for each different field. Once this was added, everything tested successfully.

Thank you
Nishen