1

I'm executing this code. I don't know if i'm missing something,

I'm using Arcpy, Python, Arcgis 10.1

whereclause1 = '"Parcelles_class.OBJECTID" = 1'
whereclause2 = '"output_table1.src_OBJECTID" = 1'
arcpy.Select_analysis("Join_Output_3","target_neighbor_parcel",whereclause1 + " OR " + whereclause2)

I got this error while i'm executing it on PYTHON window:

ERROR 001143: Background server threw an exception.

And this while i execute it in IDLE :

ERROR 000358: Expression non valide Parcelles_class.OBJECTID = 1 OR output_table1.src_OBJECTID = 1 Échec de l’exécution de (Select).

1
  • Now i get this Error : ExecuteError: ERROR 000358: Expression non valide "Parcelles_class.OBJECTID" = 1AND"output_table1.src_OBJECTID" = 1 Échec de l’exécution de (Select). – geosevda Dec 11 '14 at 11:16
1

you should put some spaces before and after the AND when you concatenate. Like this:

 + " AND " +  

also you could try and add the parentheses

"(" + whereclause1 + ") OR (" + whereclause2 + ")"
8
  • I did it ! and they give me now this : Background server threw an exception. Then the operation it stopted – geosevda Dec 11 '14 at 11:22
  • does each whereclause work independently ? – radouxju Dec 11 '14 at 11:45
  • radouxju Yes it does ! – geosevda Dec 11 '14 at 11:49
  • and what if you add parentheses around each clause? – radouxju Dec 11 '14 at 11:51
  • it gives the same error: ERROR 000358: Expression non valide "Parcelles_class.OBJECTID" = 1 OR "output_table1.src_OBJECTID" = 1 Échec de l’exécution de (Select) – geosevda Dec 11 '14 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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