Hello all, I am pretty new to programming and arcpy. I am attaching a code where I am trying to take an input country from a user and use it in the where clause to return a list of the population ranks present for that country. As it is now, it returns an error that a column was specified that does not exist. The issue is in my query, but I cannot figure out how to format it to only return results from a certain country. Don't worry about the 2nd half of the code, as I am just trying to figure out this search cursor.
Thanks!!
Solved! Go to Solution.
You want the following SQL query:
CNTRY_NAME = 'Country'
To get that as a string in PYthon:
query = "CNTRY_NAME = '{}'".format(country)
country = 'x'
f'"CNTRY_NAME" = {country}'
'"CNTRY_NAME" = x'
perhaps
You want the following SQL query:
CNTRY_NAME = 'Country'
To get that as a string in PYthon:
query = "CNTRY_NAME = '{}'".format(country)
Thank you so much! I knew it was probably an easy answer but I had been trying to wrap my head around it for hours!