Questions tagged [error-000358]

000358 : Invalid expression, an ESRI software error code, returned when a SQL expression is invalid.

Filter by
Sorted by
Tagged with
3
votes
3answers
4k views

Runtime error : ERROR 000358: Invalid expression using SelectLayerByAttribute in ArcPy?

I cannot for the life of me persuade SelectLayerByAttribute to work (I need to automate this for a complex script). Working in ArcMap's python console on already loaded shapefile, the format below: ...
0
votes
2answers
7k views

What causes ExecuteError: ERROR 000358: Invalid expression Failed to execute (SelectLayerByAttribute) on shapefile? [duplicate]

My script runs perfectly for feature classes, but not shapefiles. It crashes at the point of selection, provided there is a query. gp.Workspace = "C:/someworkspace" fc = "featureclass.shp" query = "[...
1
vote
1answer
1k views

Debugging Select By Attribute tool within loop giving ERROR 000358: Invalid expression Cannot acquire a lock?

I have seen several similar posts related to this technique but I am still having issues. The following script is intended to select all points from one shapefile that are within the boundaries of a ...
1
vote
1answer
1k views

Invalid Expression ERROR 000358: Select by Attribute

I'm attempting to select a certain point in a feature layer so I can perform buffer analysis on it. The code seems fine, but I am getting an invalid expression error: File "C:\Program Files (x86)\...
0
votes
1answer
77 views

Select_analysis in ArcPy gives ERROR 000358?

Trying to learn how to use Select_analysis but the queries cause the ERROR 000358: Invalid expression. Piece of code: arcpy.Select_analysis(in_features='test1', out_feature_class=...
4
votes
2answers
3k views

Using Python to select records by date field

I am trying to write a python script to select records created within the past 7 hours (date field - database time) using a where-clause within arcpy. The table is ArcSDE database (Microsoft SQL ...
3
votes
1answer
597 views

ArcPy inconsistently accepts SQL queries for MakeFeatureLayer or SelectLayerByAttribute

I need to buffer a subset of features in a particular feature class. To do this, I am first creating a feature layer (using a SQL query to select only what I want), and then running Buffer. So my ...
2
votes
3answers
258 views

Using “IN” for SQL statement in Python

I'm selecting all records and then removing certain values from this selection in a Python script. I've succeeded using a for loop in a SearchCursor to remove records from the selection but it is very ...
1
vote
4answers
323 views

Unsupported Operand Type for Field Query

Following on from Correct SQL expression for SelectbyAttribute Tool, I have my code: import arcpy plantFile = r"U:\Users\K\Plants.shp" field = "UID" arcpy.MakeFeatureLayer_management (plantFile, "...
1
vote
1answer
429 views

Invalid expression error 000358 when using in_memory workspace? [duplicate]

Make Feature Layer with an SQL Selection Expression against a geometry property like length fails when the source feature class is in an in_memory workspace. An otherwise identical model works just ...