Consultor Eletrônico



Kbase P26982: How to use a 4GL OUTER-JOIN QUERY to list all selected fields from the OUTER table and a logical col
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/11/2005
Status: Unverified

GOAL:

How to use a 4GL OUTER-JOIN QUERY to list all selected fields from the OUTER table and a logical column (YES/NO) indicating whether a matching INNER table record exists or not?

FIX:

FOR EACH OuterTableName NO-LOCK:
FIND FIRST InnerTableName OF OuterTableName NO-LOCK NO-ERROR.
DISPLAY
OuterTableName.FieldList
AVAILABLE(InnerTableName).
END.

For instance, the following code produces two columns, a customer name CHARACTER column and a YES/NO LOGICAL column indicating whether that customer has one order in the Order tableor not:

FOR EACH Customer NO-LOCK:
FIND FIRST Order OF Customer NO-LOCK NO-ERROR.
DISPLAY
Customer.NAME
AVAILABLE(Order).
END.