<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic update cursor invalid sql statement in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690068#M53495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm new to python so forgive me if this seems like a dumb question... I work for the city and we get parcel information monthly from the county. Usually the data comes in a text file which I then put in an mdb. I'm trying to write some code to run an update our layers with the updated monthly information. Currently, I've just been trying to get a few fields to update&amp;nbsp; inside a 'test' file geodatabase but I'm stuck. I get the following error message with the following code. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="311" src="https://community.esri.com/legacyfs/online/190779_pastedImage_1.png" style="height: 336px; width: 818.932px;" width="758" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Mar 2016 17:01:55 GMT</pubDate>
    <dc:creator>BrianLomas</dc:creator>
    <dc:date>2016-03-11T17:01:55Z</dc:date>
    <item>
      <title>update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690068#M53495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm new to python so forgive me if this seems like a dumb question... I work for the city and we get parcel information monthly from the county. Usually the data comes in a text file which I then put in an mdb. I'm trying to write some code to run an update our layers with the updated monthly information. Currently, I've just been trying to get a few fields to update&amp;nbsp; inside a 'test' file geodatabase but I'm stuck. I get the following error message with the following code. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="311" src="https://community.esri.com/legacyfs/online/190779_pastedImage_1.png" style="height: 336px; width: 818.932px;" width="758" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:01:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690068#M53495</guid>
      <dc:creator>BrianLomas</dc:creator>
      <dc:date>2016-03-11T17:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690069#M53496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure about the rest, but you don't have the same number of single and double quotes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:11:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690069#M53496</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-03-11T17:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690070#M53497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops I forgot I corrected that one... When that is taken out I get the following error...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Runtime error &lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 9, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;RuntimeError: An invalid SQL statement was used. [Parcel_092015COPY]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:16:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690070#M53497</guid>
      <dc:creator>BrianLomas</dc:creator>
      <dc:date>2016-03-11T17:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690071#M53498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try building your SQL expression in a previous line, then printing it to confirm that it is what you think it is.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:22:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690071#M53498</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-03-11T17:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690072#M53499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried doing this in model builder. Most everything you'll need should be in there and it will give you a head start if you need to do any coding. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/modelbuilder/what-is-modelbuilder.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/modelbuilder/what-is-modelbuilder.htm"&gt;What is ModelBuilder?—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 18:08:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690072#M53499</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-03-11T18:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690073#M53500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please post Python questions with the code in the question &lt;STRONG&gt;as text&lt;/STRONG&gt; (&lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2015/10/16/script-formatting"&gt;formatted in a code block&lt;/A&gt;) -- It allows others to try your code without retyping it from scratch.&amp;nbsp; If you need to redact pieces, be sure to explain what they were sufficiently so that suitable scaffolding can be applied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 18:23:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690073#M53500</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2016-03-11T18:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690074#M53501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought about model builder but this will run for more than 10,000 features so I was worried about it being too slow. Although, I'm not too familiar with MB so I may be&amp;nbsp; wrong. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 22:14:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690074#M53501</guid>
      <dc:creator>BrianLomas</dc:creator>
      <dc:date>2016-03-11T22:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690075#M53502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;are your fields really&amp;nbsp; &lt;STRONG&gt;situs&lt;/STRONG&gt; and &lt;STRONG&gt;current_ow&lt;/STRONG&gt;&amp;nbsp; or those supposed to be sites and current_row which I did a brain translation to until I looked again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 22:21:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690075#M53502</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-03-11T22:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690076#M53503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wasn't sure on how to do that, so thanks for the info. Here's the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
countyTB =...January2015Ownership.mdb\January2015Ownership'
fc = ...ParcelPythonCOPIES.gdb\Parcel_092015COPY"
with arcpy.da.SearchCursor(countyTB, ["*"]) as rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fields = rows.fields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; idfield = fields.index('PARCEL_')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor(fc,['situs', 'current_ow'], "%s = %s" % ('parcel_id', row[idfield])) as urows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for urow in urows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; urow[1] = row[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; urows.UpdateRow(urow)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del urow
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del row&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:02:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690076#M53503</guid>
      <dc:creator>BrianLomas</dc:creator>
      <dc:date>2021-12-12T05:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690077#M53504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yea, 'situs' and 'current_ow' are actual field names.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 22:25:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690077#M53504</guid>
      <dc:creator>BrianLomas</dc:creator>
      <dc:date>2016-03-11T22:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690078#M53505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just checking &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt; sometimes it is the little things...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 22:28:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690078#M53505</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-03-11T22:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690079#M53506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would probably do something along the lines of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
countyTB = r'...January2015Ownership.mdb\January2015Ownership'
fc = r'...ParcelPythonCOPIES.gdb\Parcel_092015COPY'

# create a dictionary
dct = {r[0]: r[1] for r in arcpy.da.SearchCursor(countyTB, ('PARCEL_', 'TheOtherFieldNameAtIndex1'))}

with arcpy.da.UpdateCursor(fc, ('parcel_id', 'current_ow')) as curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parcel_id = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if parcel_id in dct:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = dct[parcel_id]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curs.updateRow(row)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are reading all the fields of countyTB when you only seem to need two. For the copy you are reading the field 'situs' which I don't think you are using. Using a dictionary and looking up the data might make things a bit faster, but if your have a lot of features, it may be slow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:02:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690079#M53506</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T05:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690080#M53507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;10,000 features wouldn't be a problem. You could simply join the 2 tables then use field calculator. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Mar 2016 16:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690080#M53507</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-03-12T16:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690081#M53508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the idea... Ultimately, there will be 12 different fields that will need to be updated. The intention of this script was to run a test on just a few fields (current_ow &amp;amp; situs) for 'proof of concept'. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2016 13:29:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690081#M53508</guid>
      <dc:creator>BrianLomas</dc:creator>
      <dc:date>2016-03-14T13:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690082#M53509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked great and was very fast. However, I'm a bit confused how I can get this to cycle through multiple fields? Maybe use a getparameter to manually set the field after each cycle? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2016 21:17:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690082#M53509</guid>
      <dc:creator>BrianLomas</dc:creator>
      <dc:date>2016-03-14T21:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690083#M53510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use a dictionary with a list of values, in stead of a dictionary with a single field as value. This would require some changes in building the dictionary and the way the values are retrieved in the update cursor, but it can be done. If the code you tested was fast, it means that you don't have that many features to process. In that case it would not be a problem to create this larger dictionary (with lists as values).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2016 21:28:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690083#M53510</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-03-14T21:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690084#M53511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please remember to mark your question as answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2016 16:19:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690084#M53511</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-03-15T16:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: update cursor invalid sql statement</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690085#M53512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was having difficulty getting the dictionaries working correctly but I stumbled onto a great blog post which was the exact thing I was looking for (link below). Thanks for everyone's help, I've learned a lot&amp;nbsp; from you during this. I look forward to using python for more automation purposes in the future.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/1885" target="_blank"&gt;Turbo Charging Data Manipulation with Python Cursors and Dictionaries&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy 
... 
... sourceFC = "...January2015Ownership.mdb\January2015Ownership"
... 
... sourceFieldsList = ["PARCEL_","SITUS", "CURRENT_OWNER", "CO_OWNER", "OWNER_MAILADDR", "OWNER_CITY_STATE", "OWNER_ZIPCODE", "TAX_DISTRICT", "TAX_CODE", "SEC", "TOWNSHIP", "RANGE", "LEGAL"] 
... 
... # Use list comprehension to build a dictionary from a da SearchCursor 
... valueDict = {r[0]:(r[1:]) for r in arcpy.da.SearchCursor(sourceFC, sourceFieldsList)} 
... 
... updateFC = "...\ParcelPythonCOPIES.gdb\TaxParcel_COPY"
... 
... updateFieldsList = ['PARCELID','SITEADDRESS','OWNERNME1', 'OWNERNME2', 'PSTLADDRESS', 'PSTLCITY', 'ZIPCODE', 'TAX_DIST', 'TAX_CODE', 'SEC', 'TWN', 'RGE', 'PRPRTYDSCRP'] 
... 
... with arcpy.da.UpdateCursor(updateFC, updateFieldsList) as updateRows: 
...&amp;nbsp;&amp;nbsp;&amp;nbsp; for updateRow in updateRows: 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # store the Join value of the row being updated in a keyValue variable 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keyValue = updateRow[0] 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # verify that the keyValue is in the Dictionary 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if keyValue in valueDict: 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # transfer the values stored under the keyValue from the dictionary to the updated fields. 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for n in range (1,len(sourceFieldsList)): 
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow&lt;N&gt; = valueDict[keyValue][n-1] &lt;/N&gt;
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow) 
... 
... del valueDict &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:02:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-invalid-sql-statement/m-p/690085#M53512</guid>
      <dc:creator>BrianLomas</dc:creator>
      <dc:date>2021-12-12T05:02:36Z</dc:date>
    </item>
  </channel>
</rss>

