<?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 Re: Update cursor on joined tables? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239685#M8178</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just wrote this that solves the problem at least on a two table join. You could do more tables than just two if you are careful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What I did was to make the join field be the definition query for a search cursor on the other table. This means that for every row read by the update cursor a table with only one row will be created from the joined table. This method only works on a one to one style join. I am using parcel data so I have polys with unique IDs. Its possible to adapt this to work on a one to many join but you would just have to be careful with your naming and really think about what youre doing calculation wise so you dont get mixed up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Its actually rather quick to run too. Takes half the time of the JoinFields method on a table of ~117k records.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;try: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; U_cursor=arcpy.UpdateCursor(downloaded_parcels, '"A1RENUM" LIKE \'%-%-%\'')
&amp;nbsp;&amp;nbsp;&amp;nbsp; for U_row in U_cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; S_cursor=arcpy.SearchCursor(r"C:\GIS Projects\TaxChange\Parcels\2010 Parcels.shp", '"A1RENUM" = \'%s\'' % U_row.A1RENUM)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for S_row in S_cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if S_row.VASJUST != 0:&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;&amp;nbsp; U_row.ChgJust = ((float(U_row.VASJUST)-float(S_row.VASJUST))/S_row.VASJUST)*100
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if S_row.VASJUST == 0 and U_row.VASJUST != 0:
&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; U_row.ChgJust = 100
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if S_row.VASTAXABLE != 0:&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;&amp;nbsp; U_row.ChgTaxable = ((float(U_row.VASTAXABLE)-float(S_row.VASTAXABLE))/S_row.VASTAXABLE)*100
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if S_row.VASTAXABLE == 0 and U_row.VASTAXABLE != 0:
&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; U_row.ChgTAXABLE = 100
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; U_cursor.updateRow(U_row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del S_cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VASTAXABLEtotal+=U_row.VASTAXABLE
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VASJUSTtotal+=U_row.VASJUST
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pbar.update(pbar.currval+1)
 
finally:
&amp;nbsp;&amp;nbsp;&amp;nbsp; del U_cursor&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a simple application that just calculates the percent change in taxable value and justified value of parcels.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: I timed it, takes a third of the time to run as JoinFields + CalculateField. The whole script: &lt;/SPAN&gt;&lt;A href="http://paste2.org/p/1099256" rel="nofollow noopener noreferrer" target="_blank"&gt;http://paste2.org/p/1099256&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 12:03:59 GMT</pubDate>
    <dc:creator>ChrisMathers</dc:creator>
    <dc:date>2021-12-11T12:03:59Z</dc:date>
    <item>
      <title>Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239668#M8161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can we use an update cursor on a joined table in arcpy? I dont have 10 yet (very sad) because of a 3rd party plug-in conflict. I should have it soon so I am updating scripts for arcpy and this abilty would help me greatly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Aug 2010 15:06:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239668#M8161</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-08-02T15:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239669#M8162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes you can, and also can do this in pre-v10. But note that you can only alter field values in the input table (not the join table).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Aug 2010 17:09:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239669#M8162</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-08-02T17:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239670#M8163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Really? How do you reference the field names ("name",[name],etc)? I have never had an update cursor work on a joined table before.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Aug 2010 17:44:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239670#M8163</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-08-02T17:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239671#M8164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;inputTable = r"C:\temp\test.gdb\blah"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;joinTable = r"C:\temp\test.gdb\lut"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.makefeaturelayer(inputTable, "FL")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.addjoin("FL","ID",joinTable,"ID")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;updateRows = gp.updatecursor("FL")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;updateRow = updateRows.next()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while updateRow:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; if updateRow.getvalue("lut.ANIMAL_TYPE") == "CAT":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow.FOOD_TYPE = updateRow.getvalue("lut.ANIMAL_TYPE") + " FOOD"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; updateRows.updaterow(updateRow)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; updateRow = updateRows.next()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del updateRow&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del updateRows&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Aug 2010 18:11:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239671#M8164</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-08-02T18:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239672#M8165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;inputTable = r"C:\temp\test.gdb\blah"
joinTable = r"C:\temp\test.gdb\lut"
gp.makefeaturelayer(inputTable, "FL")
gp.addjoin("FL","ID",joinTable,"ID")
updateRows = gp.updatecursor("FL")
updateRow = updateRows.next()
while updateRow:
&amp;nbsp;&amp;nbsp; if updateRow.getvalue("lut.ANIMAL_TYPE") == "CAT":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow.FOOD_TYPE = updateRow.getvalue("lut.ANIMAL_TYPE") + " FOOD"
&amp;nbsp;&amp;nbsp; updateRows.updaterow(updateRow)
&amp;nbsp;&amp;nbsp; updateRow = updateRows.next()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
del updateRow
del updateRows&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:03:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239672#M8165</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T12:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239673#M8166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I cant create an update cursor on a joined table. This is the error given to me. I can create the cursor on an un-joined table though, but that isnt really the point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcgisscripting
gp=arcgisscripting.create(9.3)
gp.makefeaturelayer_management(r"C:\GIS Projects\CRW\TrakIt_Source_RS.gdb\Target_Data\parce_test", "parce_test")
gp.addjoin("parce_test", "A1RENUM", r"C:\GIS Projects\CRW\parce_test_spatial_join.shp", "A1RENUM")
cursor=gp.updatecursor("parce_test")
row=cursor.Next()
while row:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.Flood_zn = row.getvalue("parce_test_spatial_join.FLD_ZONE")
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updaterow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp; row=cursor.Next()
del row
del cursor
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:/GIS Projects/CRW/upgradetest", line 6, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor=gp.updatecursor("parce_test")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: ERROR 999999: Error executing function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:03:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239673#M8166</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2021-12-11T12:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239674#M8167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I swear you used to be able to do this (v92?), but now that I actually need to do it in v9.3.1 SP1, I get the same error. I hate to choke on my own claims, but I'm pretty choked up right now! Dang!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;runtimeError: ERROR 999999: Error executing function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You certainly can search the joined records (in a searchcursor), as well as use the CalculateField tool (aka Update). Hmmm...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 18:10:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239674#M8167</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-09-30T18:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239675#M8168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've tried using JoinField and then using CalculateField. But with a large data set, as small as 100,000 records,this method takes way to long to be practical.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 12:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239675#M8168</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-10-01T12:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239676#M8169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was getting this same error. I ended up having to export to a new shapefile and apply the UpdateCursor to this new shapefile.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 13:02:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239676#M8169</guid>
      <dc:creator>deleted-user-rQoEFM5qzbHE</dc:creator>
      <dc:date>2010-10-01T13:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239677#M8170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I wonder if an updatecursor would work with a FeaterLayer or TableView created with the MakeQueryTable tool?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 14:56:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239677#M8170</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-10-01T14:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239678#M8171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Verified that (9.3.1 SP1) an updatecursor does NOT work with a featurelayer/table view created with the MakeQueryTable tool. I will submit a bug report to ESRI.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 14:55:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239678#M8171</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-10-06T14:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239679#M8172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I've tried using JoinField and then using CalculateField. But with a large data set, as small as 100,000 records,this method takes way to long to be practical.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you do the calculation with a python expresssion or a VB Script expression?&amp;nbsp; A python expresssion will take 7 to 20 times as long to process as an equivalent VB Script expression on a joined table.&amp;nbsp; I do join calculations all the time in python scripts with 100,000 records and using VB Script expressions.&amp;nbsp; They usually take about 2 minutes or less per calculation, which I do not consider to be excessive (but if I had used a python expression the same calculation can take anywhere from 14 to 45 minutes, which is excessive).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 21:14:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239679#M8172</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2010-10-06T21:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239680#M8173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Verified that (9.3.1 SP1) an updatecursor does NOT work with a featurelayer/table view created with the MakeQueryTable tool. I will submit a bug report to ESRI.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The field calculator is disabled on the MakeQueryTable result as well.&amp;nbsp; I believe this behavior is intentional, because the MakeQueryTable support 1:M and M:M relationships as well as 1:1 and M:1 relationships.&amp;nbsp; Edits on one record of the in memory table could easily be overwritten with a totally different value by the same calculation through the next record processed.&amp;nbsp; The value you would wind up with would be dependent on the record order, which would make the result effectively random.&amp;nbsp; Only after the table is exported to a permanent file would all of the records be processed independently and all of the results of a calculation would be preserved without overwriting, which is what ESRI supports&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not, however, understand why standard joiins can use the field calculator and not an updatecursor.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 21:27:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239680#M8173</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2010-10-06T21:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239681#M8174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Did you do the calculation with a python expresssion or a VB Script expression? A python expresssion will take 7 to 20 times as long to process as an equivalent VB Script expression on a joined table. I do join calculations all the time in python scripts with 100,000 records and using VB Script expressions. They usually take about 2 minutes or less per calculation, which I do not consider to be excessive (but if I had used a python expression the same calculation can take anywhere from 14 to 45 minutes, which is excessive).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I suppose I was a bit vague. I mean that the gp.JoinField() takes a long time because it is adding a field or fields and calculating the data over into them. I want to avoid python code blocks in field calculator which is why I want to use a update cursor. Can anyone speak to the function of the update cursor on joined tables in v10?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Oct 2010 17:25:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239681#M8174</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-10-07T17:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239682#M8175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I suppose I was a bit vague. I mean that the gp.JoinField() takes a long time because it is adding a field or fields and calculating the data over into them. I want to avoid python code blocks in field calculator which is why I want to use a update cursor. Can anyone speak to the function of the update cursor on joined tables in v10?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You cannot do an update cursor on a joined table directly.&amp;nbsp; However, if you can define a query expression that will perform your selection and are not just working on a random user SelectionSet, the code below should work about as efficiently as doing the calculation directly on the joined table (and much more efficiently if you were using python calculations and not VB Script).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub GetLayerSelection2()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMxDoc = ThisDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFLayer As IFeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFLayer = pMxDoc.FocusMap.Layer(0) 'Get first layer

&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pQueryFilter As IQueryFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pQueryFilter = New QueryFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; pQueryFilter.WhereClasue = "ParentTableName.OBJECTID &amp;gt; 0" ' do some sort of selection on the joined table&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not TypeOf pDisplayTable.DisplayTable Is IRelQueryTable Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "Feature Layer is not joined!&amp;nbsp; Exiting Sub."
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pDisplayTable As IDisplayTable ' Variable for the joined features
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pDisplayTable = pFLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFCursor As IFeatureCursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; set pFCursor = pDisplayTable.SearchDisplayTable(pQueryFilter, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeature As IFeature
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeature = pFCursor.NextFeature
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureClass as IFeatureClass ' Variable for the unjoiined features
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeatureClass = pFLayer

&amp;nbsp;&amp;nbsp;&amp;nbsp; pQueryFilter.WhereClasue = "OBJECTID &amp;gt; 0" ' do the same selection on the unjoined table
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pUpdateCursor As IFeatureCursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pUpdateCursor = pFeatureClass.Update(pQueryFilter, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeature2 As IFeature
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeature2 = pUpdateCursor.NextFeature
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pJoinIndex As Long
&amp;nbsp;&amp;nbsp;&amp;nbsp; pJoinIndex = pDisplayTable.DisplayTable.Fields.FindField("JoinTableName.JoinField") ' Substitute the actual Join Table and Field names
&amp;nbsp;&amp;nbsp;&amp;nbsp; If pJoinIndex = -1 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "JoinTableName.JoinField Field Not Found! Exiting Sub." ' Substitute the appropriate message.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFieldIndex As Long
&amp;nbsp;&amp;nbsp;&amp;nbsp; pFieldIndex = pFeature.Fields.FindField("FieldName") ' Get an unjoined field of the parent FC to update
&amp;nbsp;&amp;nbsp;&amp;nbsp; If pFeatureIndex = -1 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "FieldName Field Not Found! Exiting Sub." ' Substitute the appropriate message
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Do Until pFeature Is Nothing ' Feature and Feature2 used the same query and run in synch.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeature2.Value(pFieldIndex) &amp;amp; " = " &amp;amp; pFeature.Value(pJoinIndex) ' transfer value of join field to field
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pUpdateCursor.UpdateFeature = pFeature2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeature2 = pUpdateCursor.NextFeature ' Get the next unjoined feature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pFeature = pFCursor.NextFeature ' Get the next matching joined feature
&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop
End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To work with a SelectionSet, you would have to translate the user selection to a whereclause expression so that you would match it on both the joined displaytable and the unjoined featureclass update cursor.&amp;nbsp; If the query expression required the join to work, then the selection would have to be done on the displaytable and an equivalent whereclause using OID values would have to be built to get the same selectionset on the unjoined featureclass.&amp;nbsp; The code only works efficiently and correctly if the same set of records are selected on the parent unjoined FC update cursor and the joined FC search cursor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I still think that VB Script expressions in the calculator are fine to use on joined data in most cases and would probably use the gp.JoinField() most of the time (VB Script expressions work within python scripts in the fieldcalculator as long as they do not require use of the code block).&amp;nbsp; Most of the time I do not need to use python code blocks on joined tables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(This is VBA, but could be translated to VB.NET fairly easily.&amp;nbsp; In any case, the underlying logic of running parallel cursors would have to be employed if this were translated to python as well.&amp;nbsp; If you wanted python I chose to ignore that point, because I don't know python that well to translate it.&amp;nbsp; But the principles of the code above should still apply to python.&amp;nbsp; Without being able to create some kind of parallel cursors the data from the join would probably have to be loaded to a dictionary and then writen to an unjoined update cursor, but getting identical selection sets is still key to running any process that would improve on the speed of a VB Script field calculation).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:03:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239682#M8175</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2021-12-11T12:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239683#M8176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FROM ESRI 10/08/2010:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Running an update cursor on a feature layer that contains in-memory tabular joins created using the AddJoin tool is not supported (in v9.3.1 or v10.0). Instead, use the JoinField tool or the CalculateField tool's VB expression."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yarrr...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems that if you were intent on not using what ESRI recommends, use a searchcursor store the "look up" values in a Python Dictionary (in memory), and then use an updatecursor on the main table and access the values stored in the dictionary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#Defines the inputs
sourceTable = gp.GetParameterAsText(0)
destinationTable = gp.GetParameterAsText(1)
sourceKey = gp.GetParameterAsText(2)
destinationKey = gp.GetParameterAsText(3)
sourceField1 = gp.GetParameterAsText(4)
destinationField1 = gp.GetParameterAsText(5)
sourceField2 = gp.GetParameterAsText(6)
destinationField2 = gp.GetParameterAsText(7)
sourceField3 = gp.GetParameterAsText(8)
destinationField3 = gp.GetParameterAsText(9)

#Process: Print out the input parameters
message = "INPUT PARAMETERS"; showPyMessage()
message = "----------------"; showPyMessage()
message = "Source Table&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = " + sourceTable; showPyMessage()
message = "Destination Table&amp;nbsp;&amp;nbsp;&amp;nbsp; = " + destinationTable; showPyMessage()
message = "Source Key&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = " + sourceKey; showPyMessage()
message = "Destination Key&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = " + destinationKey; showPyMessage()
message = "Source Field #1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = " + sourceField1; showPyMessage()
message = "Destination Field #1 = " + destinationField1; showPyMessage()
message = "Source Field #2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = " + sourceField2; showPyMessage()
message = "Destination Field #2 = " + destinationField2; showPyMessage()
message = "Source Field #3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = " + sourceField3; showPyMessage()
message = "Destination Field #3 = " + destinationField3 + "\n"; showPyMessage()

#Do some error checking
message = "Running error checks..."; showPyMessage()

#Process: Makes sure sourceTable exists
if gp.exists(sourceTable) != True:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "ERROR: " + sourceTable + " does not exist! Exiting script..."; showPyError(); sys.exit()

#Process: Makes sure the sourceKey and sourceField1 fields exist in sourceTable
fieldList = gp.listfields(sourceTable)
fieldNameList = []
for field in fieldList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldNameList.append(field.name)
if sourceKey not in fieldNameList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "ERROR: " + sourceKey + " field does not exist in " + sourceTable + "! Exiting script..."; showPyError(); sys.exit()
if sourceField1 not in fieldNameList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "ERROR: " + sourceField1 + " field does not exist in " + sourceTable + "! Exiting script..."; showPyError(); sys.exit()

#Process: Makes sure destinationTable exists
if gp.exists(destinationTable) != True:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "ERROR: " + destinationTable + " does not exist! Exiting script..."; showPyError(); sys.exit()

#Process: Makes sure the destinationKey and destinationField1 fields exist in destinationTable
fieldList = gp.listfields(destinationTable)
fieldNameList = []
for field in fieldList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldNameList.append(field.name)
if destinationKey not in fieldNameList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "ERROR: " + str(destinationKey) + " field does not exist in " + destinationTable + "! Exiting script..."; showPyError(); sys.exit()
if destinationField1 not in fieldNameList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; message = "ERROR: " + str(destinationField1) + " field does not exist in " + destinationTable + "! Exiting script..."; showPyError(); sys.exit()

#Process: Figure out what fields we need for the search cursor
searchCurFieldListString = sourceKey + ";" + sourceField1

#Process: Builds a dictionary of the sourceTable's sourceKey field values
message = "Building source dictionary..."; showPyMessage()
sourceDict = {}
searchRows = gp.searchcursor(sourceTable,"","",searchCurFieldListString)
searchRow = searchRows.next()
while searchRow:
&amp;nbsp;&amp;nbsp;&amp;nbsp; sourceKeyValue = str(searchRow.getvalue(sourceKey)) #ensure the key is a string!
&amp;nbsp;&amp;nbsp;&amp;nbsp; sourceDict[sourceKeyValue] = searchRow.getvalue(sourceField1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; searchRow = searchRows.next()
del searchRow
del searchRows

#Process: Figure out what fields we need for the update cursor
updateCurFieldListString = destinationKey + ";" + destinationField1

#Process: Updates the destinationTable
message = "Updating destination table..."; showPyMessage()
updateRows = gp.updatecursor(destinationTable,"","",updateCurFieldListString)
updateRow = updateRows.next()
while updateRow:
&amp;nbsp;&amp;nbsp;&amp;nbsp; destinationKeyValue = str(updateRow.getvalue(destinationKey)) #ensure the key is a string!
&amp;nbsp;&amp;nbsp;&amp;nbsp; if destinationKeyValue in sourceDict:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow.setvalue(destinationField1, sourceDict[destinationKeyValue])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRows.updaterow(updateRow)
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; updateRow = updateRows.next()
del sourceDict
del updateRow
del updateRows &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:03:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239683#M8176</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T12:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239684#M8177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found out that the ISelectionSet2 interface lets you create an Update cursor on a Feature Selection, so my comments about having to do special work for selection sets is not correct.&amp;nbsp; While the synchronized cursors seems to work for me it has not for another user.&amp;nbsp; I am not sure why that is occurring, so my code suggestion may not work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 15:03:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239684#M8177</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2010-11-11T15:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on joined tables?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239685#M8178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just wrote this that solves the problem at least on a two table join. You could do more tables than just two if you are careful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What I did was to make the join field be the definition query for a search cursor on the other table. This means that for every row read by the update cursor a table with only one row will be created from the joined table. This method only works on a one to one style join. I am using parcel data so I have polys with unique IDs. Its possible to adapt this to work on a one to many join but you would just have to be careful with your naming and really think about what youre doing calculation wise so you dont get mixed up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Its actually rather quick to run too. Takes half the time of the JoinFields method on a table of ~117k records.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;try: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; U_cursor=arcpy.UpdateCursor(downloaded_parcels, '"A1RENUM" LIKE \'%-%-%\'')
&amp;nbsp;&amp;nbsp;&amp;nbsp; for U_row in U_cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; S_cursor=arcpy.SearchCursor(r"C:\GIS Projects\TaxChange\Parcels\2010 Parcels.shp", '"A1RENUM" = \'%s\'' % U_row.A1RENUM)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for S_row in S_cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if S_row.VASJUST != 0:&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;&amp;nbsp; U_row.ChgJust = ((float(U_row.VASJUST)-float(S_row.VASJUST))/S_row.VASJUST)*100
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if S_row.VASJUST == 0 and U_row.VASJUST != 0:
&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; U_row.ChgJust = 100
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if S_row.VASTAXABLE != 0:&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;&amp;nbsp; U_row.ChgTaxable = ((float(U_row.VASTAXABLE)-float(S_row.VASTAXABLE))/S_row.VASTAXABLE)*100
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if S_row.VASTAXABLE == 0 and U_row.VASTAXABLE != 0:
&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; U_row.ChgTAXABLE = 100
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; U_cursor.updateRow(U_row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del S_cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VASTAXABLEtotal+=U_row.VASTAXABLE
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VASJUSTtotal+=U_row.VASJUST
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pbar.update(pbar.currval+1)
 
finally:
&amp;nbsp;&amp;nbsp;&amp;nbsp; del U_cursor&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a simple application that just calculates the percent change in taxable value and justified value of parcels.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: I timed it, takes a third of the time to run as JoinFields + CalculateField. The whole script: &lt;/SPAN&gt;&lt;A href="http://paste2.org/p/1099256" rel="nofollow noopener noreferrer" target="_blank"&gt;http://paste2.org/p/1099256&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:03:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/update-cursor-on-joined-tables/m-p/239685#M8178</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2021-12-11T12:03:59Z</dc:date>
    </item>
  </channel>
</rss>

