My AddJoin operation is failing:

    # Perform copy rows on merged csv file
    print 'start'
    aa = arcpy.Raster(SEIMF)
    arcpy.AddJoin_management(aa, "VALUE", out_dir+'lup', "VALUE", "KEEP_ALL")
    print 'end'
    #arcpy.AddJoin_management(gis_dir+SIF, "VALUE", out_dir+'lup', "VALUE", "KEEP_ALL")
    print arcpy.GetMessages()

error messages:

Executing: AddJoin C:\Users\Documents\Projects\AB\Inputs\gis\sif VALUE C:\Users\Documents\Projects\AB\Outputs\C\output\lup VALUE KEEP_ALL
Start Time: Sat Feb 22 02:27:50 2014
Failed to execute. Parameters are not valid.
ERROR 000840: The value is not a Table View.
ERROR 000825: The value is not a layer or table view
ERROR 000840: The value is not a Raster Catalog Layer.
ERROR 000840: The value is not a Mosaic Layer.
WARNING 000970: The join field VALUE in the join table sif is not indexed. To improve performance, we recommend that an index be created for the join field in the join table.
Failed to execute (AddJoin).

Does anyone know what is happening? I get this error only in the python code and can execute AddJoin just fine if I use the ArcGIS manually.

marked as duplicate by PolyGeo Dec 13 '14 at 9:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


arcpy.AddJoin_management request a layer or a table view, and you are feeding a raster dataset, which is not exactly the same.

Instead of arcpy.Raster, use arcpy.MakeRasterLayer_management. Also make sure that your layer has an attribute table (arcpy.BuildRasterAttributeTable_management), but his does not seem to be the problem in your case.

  • Thanks so much! The error is gone. However, when I open the raster in ArcGIS, I do not see any new joined columns. Any ideas on why this might be? I have checked that the table I am joining is not empty. – user1186 Feb 22 '14 at 17:47
  • 1
    Ah, I wasn't saving the temporary layer. Works now after I save it using SaveToLayerFile_management. Thank you so much again! – user1186 Feb 22 '14 at 18:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.