Multi-table Join Example

The example below shows the specification of a multi-table join being performed during reading from the SDE database. The user specifies the tables upon which the query is to be performed using the SDE30_IDs clause, while the SDE30_WHERE clause specifies how the tables are to be combined to select the features to read. Once the compound ID is specified along with the WHERE clause, the features are processed as any other feature. The feature type assigned to the feature is the name of the primary table – in this example, this is REPLICATION.

SDE30_DATASET testdset
SDE30_SERVER tuvok
SDE30_USERID joe
SDE30_PASSWORD bouncy
SDE30_INSTANCE esri_sde SDE30_VERSION_NAME joe-version

# Specify the tables upon which the table join is to be performed. SDE30_IDs REPLICATION(DIST_CENTER,REPLICATION_LAYERS)

# Now specify the WHERE clause which specifies how the three
# tables above are to be combined
SDE30_WHERE \
  “REPLICATION.REPLICATION_DATE IS NULL AND “ \
  “REPLICATION.AREA_CD = DIST_CENTER.AREA_CD AND “ \
  “REPLICATION.IDENT = REPLICATION_LAYERS.IDENT AND “ \
  “DIST_CENTER.TOWN_CD = ‘$(TOWN)’ “