Hi Paul,

sorry...but I still don't understand what you actually need to achive, the structure is now more clear while the goal, for me, is not!

See comments inline

Enrico

Paul wrote:

I have 3 class each is a child of the previous, i.e.

A has Children B
B has Children C

I can't alter the class definitions as they are mapped to legacy globals,
but I want to access them and produce information
based on whats in A, B and C.

A, B and C hold data relevent to that level, and any of the data can be
changed without effecting data below.

So far, so good.

Hence I have an query on A which tells me if anything has changed and
populate an array with the ID's

Here I start getting confused, what is your goal? It looks you need to find out what "has changed", how do you check that? The array looks like an attempt to resolve the problem...but first, let's understand the problem :)

I then want to query B and see if anything has changed AND also return anything which has changed on A (i.e. within the array of ID's).

And then so forth for C (and infact D and E).

I thought I could do the whole select with a select (x5), but the SQL got
massive and also didn't work hence I was splitting the process down to do a
query on each class.


Hope that makes sense!, ANY help much appreciated.


"Enrico Parisi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

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