AnsweredAssumed Answered

User input as a variable within an SQL query

Question asked by jackskel81 on Nov 27, 2013
Latest reply on Nov 27, 2013 by jackskel81
Hello,

This is confounding me to no end today. I created a process to select tracts that exhibit a certain job density and E/R ratio within     the city of Houston through model builder. While this works fine, I'd like to be able to apply it to other cities but to be able to do so, the job density numbers need to be changed. An input from the user would work great for this, so I tried it out. I get the prompt to put a number in , but I keep getting ERROR 000358 no matter what I try. Any help would be much appreciated. arcpy code is below:

jDensity = raw_input('Enter your value :')
arcpy.Select_analysis(input.shp, HarrisHAZ_shp, "\"ER2010\" <1 AND \"JobDens\">jDensity")


If I just put a number in place of jDensity within the sql query, it works fine,

Outcomes