SKIP-GROUP-DUPLICATES option of TENANT-WHERE
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
If a multi-tenant table is configured with a tenant group, a single instance of the table is shared by all tenants in the group (see Introduction to Database Multi-tenancy). This means that if a super tenant queries the table for all tenants in the group, the query returns exactly the same records once for each tenant in the group.
For example, if two or more tenants are in a group configured
for the Customer table, the following example displays
the same Customer data for the group multiple times—once
for every tenant in the group:
|
Because the group data is common to all the tenants in the group,
you see that same record once when the TENANT-WHERE processes
the first member of the group, once again when the TENANT-WHERE processes
the second member of the group, and so on. You may want this if
you are referring to other tables in the FOR EACH statement
that do not have the same grouping, since they would be missed otherwise.
But if you have a very simple case like the example above, with
no join or other references to groups that do not have the same
tenant membership, you probably want to skip the duplicate data.
In that case you can use the SKIP-GROUP-DUPLICATES option.
This example only displays group data for the first member of the group, and skips tenants that belong to the same group that has already been processed:
|
This is not the default behavior, because you typically do have
references to other tables in a FOR EACH block
or in a query.