- This topic has 2 replies, 2 voices, and was last updated 6 years, 1 month ago by Louis Pace.
-
AuthorPosts
-
-
October 22, 2018 at 5:40 pm #9640Louis PaceParticipant
The following code successfully finds tasks that are not associated with any agencies:
1(Task'read '() '(= (count (@ agencies)) 0) '() '() '() '())This, however, does not work:
1(TaskEntity'read '() '(= (count (@ act agencies)) 0) '() '() '() '())The “act” attribute of TaskEntity is a task. The error is “ORA-00934: group function is not allowed here”. The generated SQL is:
12345678; 16:14:07,483 DEBUG [SQLAdapter] (NexJ Main) select A.entityId, A.actId, A.locking from NJTaskEntity A, NJAct B where A.actId = B.id and B.deletedFlag = :1 and B.viewPrincipalId in (:2, :3, :4, :5, :6) and count(D.id) = :7; 16:14:07,485 DEBUG [SQLAdapter] (NexJ Main) Bind[0] = 0; 16:14:07,487 DEBUG [SQLAdapter] (NexJ Main) Bind[1] = 31DE7B1B9BDA4DE180FC6829966FF9C0; 16:14:07,489 DEBUG [SQLAdapter] (NexJ Main) Bind[2] = 5D90A8F1047146918A140D49D4238E60; 16:14:07,490 DEBUG [SQLAdapter] (NexJ Main) Bind[3] = 00000000000010008000BEEF0000000C; 16:14:07,493 DEBUG [SQLAdapter] (NexJ Main) Bind[4] = 5DC3A6C7ED43413BB19B011727DECBE0; 16:14:07,495 DEBUG [SQLAdapter] (NexJ Main) Bind[5] = 00000000000010008000BEEF0000000A; 16:14:07,497 DEBUG [SQLAdapter] (NexJ Main) Bind[6] = 0I’m assuming this is a bug? Only the A and B aliases are declared. Where did the D in the count come from? A and B join the TaskEntity table with the Act table (where tasks are stored), but agencies don’t seem to be referenced. What is going wrong, and is there some other way to read from the TaskEntity level?
Thanks for your help!
0 -
October 25, 2018 at 12:53 pm #9674SteveParticipant
That is indeed a bug. You can probably work around it by using the “any” function, e.g.
(TaskEntity’read ‘() `(not (any (@ act agencies))) ‘() ‘() ‘() ‘())0-
October 25, 2018 at 1:48 pm #9683Louis PaceParticipant
Thanks, Steve. The “any” trick appears to work. Is there anything I need to do to report this bug, or does this forum post suffice?
0
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.