Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

Getting number as parameter to use in SQL expression leads to ExecuteError: ERROR 000358?

$
0
0

In my script I am using the Select tool (arcpy.Select_analysis) and in the SQL expression, I want to use a number that I call in as a parameter. I have trying to script it like:

subsize = arcpy.GetParameter(3)

where_clause = '"AreaSqKm" > {0}'.format(subsize)

arcpy.Select_analysis(waterbodies, lg_waterbodies, where_clause)

In this example I’m entering the parameter as the number 0.0005, as a double.

I’ve tried tweaking it various ways, but every time I try to run the tool I get:
ExecuteError: ERROR 000358″ Invalid expression “AreaSqKm > 0.0005 Failed to execute (Select).

If i hard code that variable in a script as 0.0005 and run it as a stand alone it works fine. Any ideas on why it won’t run in arc?


Viewing all articles
Browse latest Browse all 767

Trending Articles