bobm007

arcpy.select invalid sql statement

Discussion created by bobm007 on Feb 26, 2013
Latest reply on Feb 27, 2013 by mzcoyle
Hi

The following script is giving a syntax errror on the arcpy.Select line.
I've tried various combinations of Quotes but I still get the invalid sql statement.
Any ideas?

# Import arcpy module
import arcpy
# Local variables:
PropertyNew = "M:\\GIS\\KMZ Irrigation East\\PropertyNew.shp"
OwnerPropertyShp = "M:\\GIS\\KMZ Irrigation East\\OwnerProperty.shp"
# Process: Select   
arcpy.Select_analysis(PropertyNew, OwnerPropertyShp, "[PARCEL_SPI] = '2003\\PP2679'")

Traceback (most recent call last):
  File "M:\GIS\KMZ Irrigation East\owner.py", line 19, in <module>
    arcpy.Select_analysis(PropertyNew, OwnerPropertyShp, "[PARCEL_SPI] = '2003\\PP2679'")
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\analysis.py", line 88, in Select
    raise e
ExecuteError: ERROR 999999: Error executing function.
An invalid SQL statement was used.
An invalid SQL statement was used.
Failed to execute (Select).

Outcomes