ESRI.ArcGIS.ADF.IMS | |
JoinTables Property | |
See Also |
ESRI.ArcGIS.ADF.IMS.Carto.Layer Namespace > Filter Class : JoinTables Property |
Visual Basic (Declaration) | |
---|---|
Public Property JoinTables As StringCollection |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public StringCollection JoinTables {get; set;} |
Allows joining an attribute table in a map layer to a non-spatial table for use in querying with the Filter.
Joining ArcSDE tables
When joining ArcSDE tables, all valid joins between the RDBMS and ArcSDE are also valid in ArcIMS. When joining tables in ArcSDE, ArcSDE layers can only be joined to other tables within the same schema in the relational database management system (RDBMS). To join ArcSDE tables, a WhereExpression clause is used for defining which tables are joined and for any additional filters using SQL syntax. Multiple joins are also permitted.
In the following example, the WhereExpression includes setting up two relates (in bold type) and filtering the selection to FIPS_CNTY='013' (in italic type).
WhereExpression="DB.CITY.CITY_FIPS = DB.SCHOOLS.CITY_FIPS
and DB.SCHOOLS.SCHOOL_ID = DB.SCHOOL_STATS.SCHOOL_ID and
DB.CITY.CNTY_FIPS='013'"
JoinTables contains two string items: DB.SCHOOLS and
DB.SCHOOL_STATS
In this statement, cities (DB.CITY) are first joined to schools (DB.SCHOOLS) using the column CITY_FIPS as the common join item. Next, the schools (DB.SCHOOLS) are joined to a table with statistics on the schools (DB.SCHOOL_STATS) using SCHOOL_ID as the join item. A further filter is placed on this query by limiting the results to schools located within a specified county, in this example, where CNTY_FIPS='013'.
The joined tables must be added to the JoinTables collection. When naming tables, the fully qualified ArcSDE table name must be used. In the above example, the two joined tables are DB.SCHOOLS and DB.SCHOOL_STATS.
Joining DBF files
When joining DBF tables, joins can be made between the shapefile DBF table and one or more external DBF tables that reside in the same directory as the shapefile. One restriction is that a joined DBF file cannot be another shapefile DBF file that is currently being used in an ArcIMS service. DBF jointable names are limited to 10 characters.
To join DBF files, JoinExpression is used. This attribute uses the syntax: "To=[master table column which will be used for joining], From=[defines a join table column which will be joined], Type=[exact or scan]".
To | Refers to the master DBF table and defines the field that is used for joining. When referring to this table, the DBF table name must be used as a prefix to the field name. The entire expression is surrounded by square brackets, e.g., joinexpression="To=[mastertable.fieldname]". |
From | Refers to the DBF table that is joined to the master DBF table and the field that is used for joining, e.g., joinexpression="From=[jointable.fieldname]". |
Type=[exact] | Defines an exact match relation that permits only a single match between the master and join tables. Both one-to-one and many-to-one relations are exact match relations. In a one-to-one relation, there is only one record in the master that matches a single record in the join table. In a many-to-one relation, there are one or more records in the master that match a single join record. If there are multiple join records that match a single master record, then a composite record is only generated for the first join record. |
Type=[scan] | In a scan relation, if there are multiple join records for a master record, there is one composite record in the extended data file for each of the matching join records. Both one-to-many and many-to-many relations are scan relations. In a one-to-many relation, each record in the master can have multiple matching join records. A many-to-many relation is the same as one-to-many, except that different master records can match the same join record. |
To, From, and Type parameters are case sensitive (first letter is capitalized), and they are separated by a comma, ",". Any number of joined tables can be defined in the joinexpression attribute. Joined tables are separated by a semicolon, ";" such as the following:
JoinExpression="To=[A.ID],From=[B.ID],Type=[scan];To=[B.NAME],From=[C.NAME],Type=[exact]"
All joined DBF tables must be included in the JoinTables collection. When naming tables, the name of the DBF file without the extension is used. An example when querying DBF tables is:
JoinExpression="To=[counties.CNTY_FIPS],From=[countyinfo.FIPS],Type=[scan];
To=[countyinfo.FIPS],From=[state_roads.FIPS],Type=[scan]"
JoinTables contains two string items: countyinfo and
state_roads
WhereExpression="counties.NAME='Washoe'"
In this example, a county DBF file (counties.dbf) is first joined to a DBF file containing county information (countyinfo.dbf). They are joined on the field FIPS (counties.CNTY_FIPS and countyinfo.FIPS). Next, countyinfo.dbf is joined to state_roads.dbf, once again using FIPS as the join item. The jointables are countyinfo and state_roads. The query is filtered to only include one county, in this case Washoe.
When joining DBF files to a shapefile, the DBF file cannot be read-only. An indication of this problem is that the data are not drawn on the map.