Lahav Thanks for the feedback.
After writing up the question and sending it I tried to do a query
where I just wanted to get all the parents when there is a child. It turns out
the trick was to think a bit odd about the question.
If you query under ORDA and there is no result you get “null” back, instead of
an empty set. Using this Idea I tried to do the query like this.
$records:=ds.Parents.query (“childReference_return # null”)
This gives me a list of exactly what I want. Of course I can’t check directly
to see if there is more than a quantity of children, but for what I need it was
good enough. I think to check for a quantity of children I would have to likely
use an eval.
> On Apr 27, 2020, at 1:00 PM, lists via 4D_Tech <[email protected]> wrote:
>
> Take a look at FORMULA and eval() syntax in queries...
>
> Lahav
>
> -----Original Message-----
> From: 4D_Tech <[email protected]> On Behalf Of Eric Naujock via
> 4D_Tech
> Sent: Monday, April 27, 2020 10:54 AM
> To: Technical iNug 4D <[email protected]>
> Cc: Eric Naujock <[email protected]>
> Subject: Using the length parameter in a ORDA query.
>
> I am trying to preform an unusual query. I em effectively thing to find all
> the records in a parent where the parent has children. Any suggestions other
> than build a collection of records primary keys and use an “in” conditional.
> Which feels dirty.
>
>
> This this case I have a table “cases” with records and a Child table with
> records. There is a one to many relationship from child to parent with a
> return path of “childReference_return” I am looking for all the parents who
> have children. There is more to the query but I am only looking at this
> parent child element.
>
>
>
> I have tried using something like.
>
> $records:=ds.Parents.query (“childReference_return.length>0”)
>
> But when I do this I get null back.
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive: http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub: mailto:[email protected]
> **********************************************************************
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive: http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub: mailto:[email protected]
> **********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************