Something special with in_memory field names?

706
1
10-18-2013 07:03 AM
JamesCrandall
MVP Frequent Contributor
I can't believe I am struggling with this as I have other implementations doing this exact same thing but for some reason my join is not working correctly or as expected.

The process peforms a join between a FeatureClass in a FGDB and an "in_memory" table.  The table(s) is created with ExtractValuesToTable_ga, so I have a "SrcID_Feat" field that matches up to the FeatureClass' "OBJECTID_1" field.  If I output the table(s) to disk and perform the exact same join it works just fine.  However, with the same exact parameters defined using arcpy.AddJoin_management the join fails.

Well, it joins just fine but the joined fields are empty and no errors.

I am wondering if there is some difference in field names?  If I print out the field names during runtime, they all look good (exactly as they are if they are coming from the tables on disk).

Stuck.



gridLyrName = "gridFC"
if arcpy.Exists( r"C:\Extract.gdb\Transects_Selector"):
    glyr =  r"C:\Extract.gdb\Transects_Selector"
    arcpy.MakeFeatureLayer_management(glyr, gridLyrName)

arcpy.env.workspace = "in_memory"
arcpy.env.overwriteOutput = True

tabs = arcpy.ListTables()
for t in tabs:
      
    if "tab" in t:
      memtab = "trans_" + t
      arcpy.MakeTableView_management(t, memtab)
      arcpy.AddJoin_management(gridLyrName, "OBJECTID_1", memtab, "SrcID_Feat", "KEEP_ALL")

      arcpy.CopyFeatures_management(gridLyrName, r"C:\Extract.gdb\\" + memtab)
      arcpy.RemoveJoin_management(gridLyrName)



FeatClass fields:
OBJECTID_1
OBJECTID
Shape
row
column_
delx
dely
area
transectID
Shape_Length
Shape_Area

Table(s) fields:
OID
Value
SrcID_Feat
SrcID_Rast
Warning
Tags (2)
0 Kudos
1 Reply
JamesCrandall
MVP Frequent Contributor
bump to the top
0 Kudos