Join Field (Data Management) (ArcInfo only) |
|
|
Release 9.3
Last modified March 8, 2012 |
Print all topics in : "Tools" |
NOTE: This topic was updated for 9.3.1.
Joins the contents of a table to another table based on a common attribute field, while adding only user-specified fields. This join will permanently update the Input Dataset.
The records in the Input Dataset are matched to the records in the Join Table based on the Input Join Field and the Output Join Field when the values are equal. Optionally, only desired fields can be selected from the Join Table and appended to the Input Dataset during the join.
Illustration
Usage tips
All fields in the Input Dataset will be kept during the join. Optionally, only selected fields from the Join Table will be added to the output. These can be checked under the Join Fields parameter.
If no fields are selected for the optional Join Fields parameter, the default is to add all fields from the Join Table to the output.
The input can be a feature class, table, or shapefile.
Records from the Join Table can be matched to more than one record in the Input Dataset.
Joins can be sorted based on fields of types text, date, or number.
Joins based on text fields are case sensitive.
Fields of different number formats can be joined as long as the values are equal. For example, a field of type float can be joined to a short integer field.
The input field and join field can have different names.
If a join field has the same name as a field from the input table, the joined field will be appended by _1 (or _2 or _3, etc.) to make it unique.
If values in the Output Join Field are not unique, only the first occurrence of each value will be used.
Command line syntax
An overview of the Command Line window
joinfield_management <in_data> <in_field> <join_table> <join_field> {fields}
| Parameter | Explanation | Data Type |
| <in_data> |
The table or feature class to which the join table will be joined |
Table|Feature Class |
| <in_field> |
The field in the input table on which the join will be based |
Field |
| <join_table> |
The table to be joined to the input table |
Table|Feature Class |
| <join_field> |
The field in the join table that contains the values on which the join will be based |
Field |
| {fields} |
Select desired fields from the join table to be included in the join |
Field |
JoinField test1_input id test1_join id field31;field4
Scripting syntax
About getting started with writing geoprocessing scripts
joinfield_management (in_data, in_field, join_table, join_field, fields)
| Parameter | Explanation | Data Type |
| in_data (Required) |
The table or feature class to which the join table will be joined |
Table|Feature Class |
| in_field (Required) |
The field in the input table on which the join will be based |
Field |
| join_table (Required) |
The table to be joined to the input table |
Table|Feature Class |
| join_field (Required) |
The field in the join table that contains the values on which the join will be based |
Field |
| fields (Optional) |
Select desired fields from the join table to be included in the join |
Field |
# Create the geoprocessor
import arcgisscripting
gp = arcgisscripting.create(93)
# Set the current workspace
gp.Workspace = "c:/test_data"
# Join two feature classes by the zonecode field and only carry over the land use and land cover fields
gp.joinfield ("zion_park", "zonecode", "zion_zoning", "zonecode", "land_use; land_cover")