I'm trying to get the Assetgroup field values where assetgroup field values is equal to High Voltage Transformer. I am using this set of code
assetgroup = {}
assettype = {}
if searchfield == True:
for key in subtypename:
where_clause = "ASSETGROUP = 'High Voltage Transformer' = "+ str(key)
with arcpy.da.SearchCursor(fc,field_name,where_clause) as cursor:
for row in cursor:
if subtypename[row[0]] in assetgroup:
assetgroup[subtypename[row[0]]] +=1
else:
assetgroup[subtypename[row[0]]] = 1
if codedvalue[row[1]] in assettype:
assettype[codedvalue[row[1]]] += 1
else:
assettype[codedvalue[row[1]]] = 1
But getting error . Not able to figure out where am i doing wrong
Traceback (most recent call last):
File "D:\ARCPY\Transformer_Customer_Count_\transformer.py", line 41, in <module>
for row in cursor:
RuntimeError: An invalid SQL statement was used. [SELECT OBJECTID,ASSETGROUP,ASSETTYPE FROM ElectricDevice WHERE ASSETGROUP = 'High Voltage Transformer' = 0]