Consultor Eletrônico



Kbase 12590: Outer Joins In V7 Using A Browser
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Outer Joins In V7 Using A Browser

HOW TO CREATE OUTER JOINS IN THE USER INTERFACE BUILDER

An outer join is a join between two tables where PROGRESS displays the
details of a record in one table whether or not there is a
corresponding record in the other table.

Follow these steps to create a one-to-one outer join in the User
Interface Builder (UIB):

1) Create a browse widget.

2) Select the two tables you want to join together. We will refer
to the first table you select as the "master" table. We will
refer to the second table you select as the "slave" table.
The slave table may contain a record that matches the join
criteria created for the browse widget.

3) From the two tables, select the fields that you want PROGRESS to
display.

4) Follow these steps to edit the .w code created by the UIB in
step 1:

a) Define local variables for the fields in the slave table that
you want PROGRESS to display in the browse widget.
b) Substitute these local variable names for the field names in
the DEFINE BROWSE statement. To be complete, you can also
change these names in the browse widget rebuild information.
c) Remove the slave file name from the DEFINE QUERY and OPEN
QUERY statements.
d) Add a FIND session trigger. In the FIND trigger, if a slave
record is available, retrieve the slave record and
assign the local variables. If a slave record is not
available, set the local variables to null, blank, or the
unkown value according to their datatypes. This FIND trigger
fires for each record the BROWSE statement retrieves.

If there is more than one slave record for each master record,
PROGRESS returns only the first slave record and ignores the rest.

If you want PROGRESS to return all of the slave records in a
one-to-many situation, create two browse widgets so that
PROGRESS displays the master records in one browse widget, and the
related slave records in the other browse widget.

Progress Software Technical Support Note # 12590