Hi Paul,

I don't fully understand your question, what do you mean with "if its parent is in the array of objects" ?

I cannot be precise but I think you can get advantage of Cach� implici joins like "Parent->ID" to get the ID of a referenced table.

Maybe something like this?

Select <whatever>
from tab3
where tab2->tab1->ID = ParentID

In this case tab1 is parent, tab2 is child, tab3 is the SQL projected array.

If you post a sample tables structire it would be easier to help you.

Ciao

Enrico

Paul wrote:
Hello All,
    Not being a SQL whiz I've got a "surely" simple problem, can someone
help?


I have an array of objects and wish to select on a child table if its parent is in the array of objects, how do I write this in SQL?

I want in logic terms this...

SELECT * FROM Table WHERE Field1=:VAR1 OR $D(:ARRAY(Parent->ID))

But ofcourse $D isn't an SQL function! I can't figure how to do it in SQL..


Any help much appreciated.


Thankyou






Reply via email to