I'm working in ArcGIS Pro and writing rows from a source file with Text data type field to another text field in a target file but it generates an error as such:
An invalid SQL statement was used. [SELECT unique_id2, Col2, OID FROM fc2 WHERE unique_id2 is equal to 274162].
*note 274162 is the first value of unique_id1 which is also present in unique_id2. Below is my script:
with arcpy.da.SearchCursor(fc1, ["unique_id1","Col1"]) as cursor:
for row in cursor:
SQL_stat = "unique_id2 is equal to " +str(row[0])
with arcpy.da.UpdateCursor(fc2, ["unique_id2", "Col2"], SQL_stat) as cursor1: #Error
for row1 in cursor1
My code works if the fields are Integer and not texts, but I need to work with text fields. Also a print statement of the SQL_stat prints out the WHERE clause as it ought to
'274162'
. Try that.