rjcoleman

Join Script not working when copying or appending to SDE

Discussion created by rjcoleman on Dec 17, 2010
The following is my python script from model builder that's supposed to take the parcels and dbf, join them and then append the streets, addresses and parcels to SDE with the new information (to avoid potential lock problems). It works alright except for the join is not appending properly to SDE. After the script has run I can look at the Parcels feature class in CountyData_Updates and see that it has indeed joined the dbf file to the Parcels correctly but on SDE it shows the original copy of the Parcels without the joined fields from the dbf file. Is there something I'm doing wrong here? Please let me know!

# Import system modules
import sys, string, os, arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")


# Local variables...
alladds = "C:\\Data\\BeaufortGIS\\CountyData_Updates.gdb\\alladds"
allstreets = "C:\\Data\\BeaufortGIS\\CountyData_Updates.gdb\\allstreets"
Parcels = "C:\\Data\\BeaufortGIS\\CountyData_Updates.gdb\\Parcels"
gisfile_dbf = "C:\\Data\\BeaufortGIS\\gisfile.dbf"
Parcels__2_ = "C:\\Data\\BeaufortGIS\\CountyData_Updates.gdb\\Parcels"
#BeaufortParcel = "C:\\Data\\BeaufortGIS\\UploadtoSDE.gdb\\BeaufortParcel"
BeaufortStreet = "C:\\Data\\BeaufortGIS\\UploadtoSDE.gdb\\BeaufortStreet"
BeaufortAddress = "C:\\Data\\BeaufortGIS\\UploadtoSDE.gdb\\BeaufortAddress"
TargetParcel = "Database Connections\\tobarcweb.sde\\sde.DBO.BeaufortCounty\\BeaufortParcel"
TargetStreet = "Database Connections\\tobarcweb.sde\\sde.DBO.BeaufortCounty\\BeaufortStreet"
TargetAddress = "Database Connections\\tobarcweb.sde\\sde.DBO.BeaufortCounty\\BeaufortAddress"

# Process: Join Field...
gp.JoinField_management(Parcels, "PIN_", gisfile_dbf, "PIN", "")

# Process: Copy...
#gp.Copy_management(Parcels__2_, BeaufortParcel, "")

# Process: Copy (2)...
gp.Copy_management(allstreets, BeaufortStreet, "FeatureClass")

# Process: Copy (3)...
gp.Copy_management(alladds, BeaufortAddress, "FeatureClass")

# Process: Delete Features...
gp.DeleteFeatures_management(TargetParcel)

# Process: Delete Features (2)...
gp.DeleteFeatures_management(TargetStreet)

# Process: Delete Features (3)...
gp.DeleteFeatures_management(TargetAddress)

# Process: Append...
gp.Append_management(Parcels__2_, TargetParcel, "NO_TEST", "#")

# Process: Append (2)...
gp.Append_management(BeaufortStreet, TargetStreet, "NO_TEST", "#")

# Process: Append (3)...
gp.Append_management(BeaufortAddress, TargetAddress, "NO_TEST", "#")

# Process: Delete...
#gp.Delete_management(BeaufortParcel, "")

# Process: Delete (2)...
gp.Delete_management(BeaufortStreet, "")

# Process: Delete (3)...
gp.Delete_management(BeaufortAddress, "")

Outcomes