Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SQLDataSource: datetime field extra OR condition in where clause

    SmartClient Version: v12.1p_2020-09-18/Enterprise Deployment (built 2020-09-18)
    Oracle 12c

    Hello, I've got a question about the generation of the where clause when I've got a criteria regarding a datetime field, ie:

    Code:
            DSRequest req = new DSRequest("JPC_LISTINI", "fetch", rpcManager);
            req.setAdvancedCriteria(new AdvancedCriteria(
                    DefaultOperators.And,
                    new SimpleCriterion("DATA_INIZIO", DefaultOperators.LessThan, new Date()))
            );
            req.execute();
    That criteria produces this condition in the where clause:

    Code:
    (JPC_LISTINI.DATA_INIZIO < TO_DATE('2020-09-23 11:00:29','YYYY-MM-DD HH24:MI:SS') OR JPC_LISTINI.DATA_INIZIO IS NULL)
    My doubt is: why the 'OR field IS NULL' condition ?
    Actually I have to add and extra NotNullCriterion to circumvent it.
    Last edited by claudiobosticco; 23 Sep 2020, 01:47. Reason: added db version

    #2
    Hi claudiobosticco,

    see these threads, it's on purpose. I had the same question.
    1. https://forums.smartclient.com/forum...eater_or_equal
    2. https://forums.smartclient.com/forum...equal-operator
    Best regards
    Blama

    Comment


      #3
      Thanks Blama !

      Comment

      Working...
      X