Freeform query

Posted by Aleramo on 04-Apr-2012 05:58

Hello, i have a question, i use Progress 9, and i need to do modify the query in a Smart Data Object. I have three tables, AnCli00F, AnCli040F and CaDomanda, i need to get all the record from AnCli040F in wich the record in CaDomanda are not available. I mean, i need the sdo does this query:

FOR EACH AnCli00F WHERE AnCli00F.CognCli BEGINS "Rossi" NO-LOCK:
FIND FIRST AnCli040F WHERE AnCli040F.CodGest = 20
AND AnCli040F.CodCli  = AnCli00F.CodCli NO-LOCK NO-ERROR.
IF AVAIL Ancli040F THEN DO:
FIND FIRST CaDomanda WHERE AnCli040F.CodGest = CaDomanda.CodGest
AND AnCli040F.CodCli  = CaDomanda.CodCli NO-LOCK NO-ERROR.
IF NOT AVAIL CaDomanda THEN DO:
DISP AnCli040F.CodCli.
END.
END.
END.

and i thought to insert in the sdo this query:

DEFINE QUERY q1 FOR  AnCli00F, AnCli040F, CaDomanda.

OPEN QUERY q1 FOR EACH AnCli00F NO-LOCK WHERE AnCli00F.CognCli BEGINS "Rossi",
EACH  AnCli040F OF AnCli00F  OUTER-JOIN NO-LOCK WHERE AnCli040F.CodGest = 20,
FIRST CaDomanda OF AnCli040F OUTER-JOIN NO-LOCK.

GET FIRST q1.

REPEAT WHILE AVAILABLE AnCli00F:
IF NOT AVAIL CaDomanda THEN
DISP AnCli040F.CodCli WITH 1 COL.
ELSE
DISP CaDomanda WITH 1 COL.

GET NEXT q1.
END.

but i do not know how to do this, because i began to develop in ABL with progress 10, so i thought to write this query in the Trigger, but this client uses Progress 9, and i do not know how to insert this query in the sdo.

What can i solve this problem?

Bye, Marco.

All Replies

This thread is closed