<?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: OBJECTID in an UpdateCursor in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309321#M24126</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am still not sure why it can't match my csv file to the objectid in the update cursor. I have tried you suggestion and it still not doing anything. I am leaving for the day and will start fresh tomorrow. Any other suggestions you have would be greatly appreciated. I did run the code in the python ide in ArcMap and I am getting no errors, it is just not finding my numbers in the objectid field. Tomorrow I may try a searchcursor and see if that finds it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kathy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Oct 2020 20:05:59 GMT</pubDate>
    <dc:creator>KathyJohnson1</dc:creator>
    <dc:date>2020-10-20T20:05:59Z</dc:date>
    <item>
      <title>OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309313#M24118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am writing a python script that reads a csv file that contain the OBJECTID and a CompKey. I am using a csv dictionary to store the values in. Once they are read in, I want to use an updatecursor to update the compkey based on a matching OBJECTID, but I can't get the update cursor to find any matching values. My update cursor looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;with &lt;/SPAN&gt;arcpy.da.UpdateCursor(fc, fc_fields) &lt;SPAN style="color: #000080; font-weight: bold;"&gt;as &lt;/SPAN&gt;cursor:
     &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;cursor:
         OBJECTID = (row[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;])
         &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;OBJECTID
 &lt;SPAN style="color: #808080;"&gt;# this loop is to assign each field in the dictionary to the cooresponding field in the fc_fields list
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;         &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;csvdict.has_key(OBJECTID):
             &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'found OBJECTID for {}'&lt;/SPAN&gt;.format(OBJECTID))
             row[&lt;SPAN style="color: #0000ff;"&gt;1&lt;/SPAN&gt;] = csvdict[OBJECTID][&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]
             cursor.updateRow(row)
             &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;cursor
         &lt;SPAN style="color: #000080; font-weight: bold;"&gt;else&lt;/SPAN&gt;:
             &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'no matching OBJECTID'&lt;/SPAN&gt;)

When I run the entire script all I get is the no matching objectid. The above script worked when comparing 
to a field other than OBJECTID. When I change OBJECTID to UNITID, it works, the problem is UNITID is not a
unique value, so I am getting duplicates. Any help would be greatly appreciated.&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:47:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309313#M24118</guid>
      <dc:creator>KathyJohnson1</dc:creator>
      <dc:date>2021-12-11T14:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309314#M24119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you defining fc_fields?&amp;nbsp; Is it just ["OID@", "CompKey"]?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2020 18:53:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309314#M24119</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-10-19T18:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309315#M24120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I thought about that late last night as I hadn't given all the information.&amp;nbsp; In my script this is what I have that runs with no errors, but it doesn't do anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fc_fields = [&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'OBJECTID'&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'COMPKEY'&lt;/SPAN&gt;]

When I tried to use &lt;A href="mailto:OID@," rel="nofollow noopener noreferrer" target="_blank"&gt;OID@,&lt;/A&gt; if I replaced it everywhere I had OBJECTID, I ended up with errors first with this bolded line below:
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;with &lt;/SPAN&gt;arcpy.da.UpdateCursor(fc, fc_fields) &lt;SPAN style="color: #000080; font-weight: bold;"&gt;as &lt;/SPAN&gt;cursor:
     &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;cursor:
         &lt;STRONG&gt;OID@ = (row[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;])&lt;/STRONG&gt;
         &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;OBJECTID
 &lt;SPAN style="color: #808080;"&gt;# this loop is to assign each field in the dictionary to the cooresponding field in the fc_fields list
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;         &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;csvdict.has_key(OID@):
             &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'found OBJECTID for {}'&lt;/SPAN&gt;.format(OID@))
             row[&lt;SPAN style="color: #0000ff;"&gt;1&lt;/SPAN&gt;] = csvdict[OID@][&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]
             cursor.updateRow(row)
             &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;cursor
         &lt;SPAN style="color: #000080; font-weight: bold;"&gt;else&lt;/SPAN&gt;:
             &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'no matching OBJECTID'&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:47:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309315#M24120</guid>
      <dc:creator>KathyJohnson1</dc:creator>
      <dc:date>2021-12-11T14:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309316#M24121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I&amp;nbsp;wonder if using OID@ as a variable name is causing you the problem.&amp;nbsp; Change that to something like&amp;nbsp; myOID....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2020 17:35:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309316#M24121</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-10-20T17:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309317#M24122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is my new code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;#I have a CSV that contains the information required to populate the COMPKEY based on myOID.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;#Need to pick which layer you are adding COMPKEY's
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;import &lt;/SPAN&gt;csv, arcpy

&lt;SPAN style="color: #808080;"&gt;# set the database to connect to and the csv file to read
&lt;/SPAN&gt;workspace = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;r"Database Connections\Connection to hwdsql02.sde"
&lt;/SPAN&gt;CompKey= &lt;SPAN style="color: #008000; font-weight: bold;"&gt;r"C:\GIS\Python\CompKey.csv"
&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# Create a Describe object for an SDE database; to make sure connecting to proper version
&lt;/SPAN&gt;desc = arcpy.Describe(workspace)

&lt;SPAN style="color: #808080;"&gt;# Print Connection properties
&lt;/SPAN&gt;cp = desc.connectionProperties
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;\n&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;Database Connection Properties:"&lt;/SPAN&gt;)
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"%-12s %s" &lt;/SPAN&gt;% (&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"  Server:"&lt;/SPAN&gt;, cp.server))
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"%-12s %s" &lt;/SPAN&gt;% (&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"  Instance:"&lt;/SPAN&gt;, cp.instance))
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"%-12s %s" &lt;/SPAN&gt;% (&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"  Database:"&lt;/SPAN&gt;, cp.database))
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"%-12s %s" &lt;/SPAN&gt;% (&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"  Version:"&lt;/SPAN&gt;, cp.version))

arcpy.env.workspace = workspace

&lt;SPAN style="color: #808080;"&gt;#start an edit session
&lt;/SPAN&gt;edit = arcpy.da.Editor(workspace)

&lt;SPAN style="color: #808080;"&gt;# Edit session is started without an undo/redo stack for versioned data
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# (for second argument, use False for unversioned data): startEditing ({with_undo}, {multiuser_mode})
&lt;/SPAN&gt;edit.startEditing(&lt;SPAN style="color: #000080;"&gt;True&lt;/SPAN&gt;, &lt;SPAN style="color: #000080;"&gt;True&lt;/SPAN&gt;)
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"start an edit session"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;# Start an edit operation
&lt;/SPAN&gt;edit.startOperation()

&lt;SPAN style="color: #808080;"&gt;# set up some variables; fc=feature class; csvdict=CSV Dictionary
&lt;/SPAN&gt;fc = &lt;SPAN style="color: #008000; font-weight: bold;"&gt;r"sdedpwutilities.DBO.WaterDistribution\ sdedpwutilities.DBO.wMain"
&lt;/SPAN&gt;
myOID = [&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'OID@'&lt;/SPAN&gt;]
fc_fields = [&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'OID@'&lt;/SPAN&gt;,&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'COMPKEY'&lt;/SPAN&gt;]
csvdict = {}
header = &lt;SPAN style="color: #000080;"&gt;True
&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;#Read the CSV File and store in csvdict dictionary
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;with &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;open&lt;/SPAN&gt;(CompKey, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'r'&lt;/SPAN&gt;) &lt;SPAN style="color: #000080; font-weight: bold;"&gt;as &lt;/SPAN&gt;f:
    reader = csv.reader(f)
&lt;SPAN style="color: #808080;"&gt;#skip header
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;_ = &lt;SPAN style="color: #000080;"&gt;next&lt;/SPAN&gt;(f)
    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;reader:
       key = [&lt;SPAN style="color: #000080;"&gt;int&lt;/SPAN&gt;(row[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;])]
&lt;SPAN style="color: #808080;"&gt;#       print (key)
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;       &lt;/SPAN&gt;csvdict[row[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]] = [row[&lt;SPAN style="color: #0000ff;"&gt;1&lt;/SPAN&gt;]]
       &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;(csvdict)
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"That was the dictionary"
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
#cursor to update the fc
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;with &lt;/SPAN&gt;arcpy.da.UpdateCursor(fc, fc_fields) &lt;SPAN style="color: #000080; font-weight: bold;"&gt;as &lt;/SPAN&gt;cursor:
     &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;cursor:
         myOID = (row[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;])
         &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;myOID
 &lt;SPAN style="color: #808080;"&gt;# this loop is to assign each field in the dictionary to the cooresponding field in the fc_fields list
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;         &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;csvdict.has_key(myOID):
             &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'found myOID for {}'&lt;/SPAN&gt;.format(myOID))
             row[&lt;SPAN style="color: #0000ff;"&gt;1&lt;/SPAN&gt;] = csvdict[myOID][&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]
             cursor.updateRow(row)
             &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;cursor
         &lt;SPAN style="color: #000080; font-weight: bold;"&gt;else&lt;/SPAN&gt;:
             &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;'no matching myOID'&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;# Stop the edit session and save the changes: stopEditing (save_changes) default value is true
&lt;/SPAN&gt;edit.stopEditing(&lt;SPAN style="color: #000080;"&gt;True&lt;/SPAN&gt;)
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"stop an edit session"&lt;/SPAN&gt;)

&lt;SPAN style="color: #000080; font-weight: bold;"&gt;del &lt;/SPAN&gt;cursor&lt;/PRE&gt;&lt;P&gt;This is a partial of the output in PyCharm:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{'321972': ['463250'], '321973': ['463676'], '321970': ['463032'], '321971': ['463248'], '321974': ['463680'], '454363': ['463885'], '454344': ['463692'], '454342': ['463687'], '454380': ['464931'], '454381': ['464932'], '454382': ['464950'], '454383': ['464965'], '454384': ['469329'], '454385': ['469330'], '454386': ['469341'], '321969': ['463031'], '454371': ['464118'], '454370': ['463928'], '454373': ['464837'], '454372': ['464564'], '454374': ['464838'], '454377': ['464887'], '454376': ['464839'], '454379': ['464921'], '454378': ['464920']}&lt;BR /&gt;That was the dictionary&lt;BR /&gt;1&lt;BR /&gt;no matching myOID&lt;BR /&gt;2&lt;BR /&gt;no matching myOID&lt;BR /&gt;3&lt;BR /&gt;no matching myOID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still not working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:47:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309317#M24122</guid>
      <dc:creator>KathyJohnson1</dc:creator>
      <dc:date>2021-12-11T14:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309318#M24123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I took the liberty of using the Syntax Highlighter to format you code.&amp;nbsp; I &lt;EM&gt;think&lt;/EM&gt; it's right.&amp;nbsp; Look at lines 63 through 75, in particular line 69; I think it needs to be indented so the if statement is within the 'for' loop at line 64. ('If' should line up with line 66).&amp;nbsp; Also, can you verify your csv is being read into the dictionary properly?&amp;nbsp; For scripts like this with several moving parts, I like to run them in a console piece by piece to make sure everything is functioning the way I want them to.&amp;nbsp; I use Spyder, but I think Pycharm can do the same thing...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#I have a CSV that contains the information required to populate the COMPKEY based on myOID.&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#Need to pick which layer you are adding COMPKEY's&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; csv&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;# set the database to connect to and the csv file to read&lt;/SPAN&gt;
workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"Database Connections\Connection to hwdsql02.sde"&lt;/SPAN&gt;

CompKey&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\GIS\Python\CompKey.csv"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create a Describe object for an SDE database; to make sure connecting to proper version&lt;/SPAN&gt;


desc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Print Connection properties&lt;/SPAN&gt;
cp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;connectionProperties
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"\nDatabase Connection Properties:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%-12s %s"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"  Server:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;server&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%-12s %s"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"  Instance:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;instance&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%-12s %s"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"  Database:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;database&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%-12s %s"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"  Version:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;version&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; workspace

&lt;SPAN class="comment token"&gt;#start an edit session&lt;/SPAN&gt;
edit &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Editor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Edit session is started without an undo/redo stack for versioned data&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# (for second argument, use False for unversioned data): startEditing ({with_undo}, {multiuser_mode})&lt;/SPAN&gt;

edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"start an edit session"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Start an edit operation&lt;/SPAN&gt;

edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startOperation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# set up some variables; fc=feature class; csvdict=CSV Dictionary&lt;/SPAN&gt;
fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"sdedpwutilities.DBO.WaterDistribution\ sdedpwutilities.DBO.wMain"&lt;/SPAN&gt;

myOID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OID@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
fc_fields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OID@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'COMPKEY'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
csvdict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
header &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Read the CSV File and store in csvdict dictionary&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; open&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;CompKey&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'r'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; f&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    reader &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; csv&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;reader&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#skip header&lt;/SPAN&gt;
    _ &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; next&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; reader&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
       key &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#       print (key)&lt;/SPAN&gt;
       csvdict&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
       &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;csvdict&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"That was the dictionary"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#cursor to update the fc&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fc_fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
     &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
         myOID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
         &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; myOID
 &lt;SPAN class="comment token"&gt;# this loop is to assign each field in the dictionary to the cooresponding field in the fc_fields list&lt;/SPAN&gt;
        
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; csvdict&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;has_key&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myOID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
             &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'found myOID for {}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myOID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
             row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; csvdict&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;myOID&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
             cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
             &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; cursor
         &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
             &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'no matching myOID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Stop the edit session and save the changes: stopEditing (save_changes) default value is true&lt;/SPAN&gt;


edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stopEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"stop an edit session"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:47:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309318#M24123</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T14:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309319#M24124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I copied your script and tried to run again. It did do new things. It is now executing this part of the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myOID &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;print&lt;/SPAN&gt; myOID&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As it printed all the OID, the it said no matching myOID statement and ended the edit. I am wondering if the OID is coming in from the CSV as text and not an integer. I know how to force it to be a float variable, but was not sure how to make it an integer, which is believe is what it needs to be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:48:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309319#M24124</guid>
      <dc:creator>KathyJohnson1</dc:creator>
      <dc:date>2021-12-11T14:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309320#M24125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG style="background-color: #ffffff; "&gt;OID is coming in from the CSV as text and not an integer....&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;That's the sort of thing you can check by running each segment of code a priori in the console to make sure it is behaving the way you want it to, and not just how you told it to.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Here is an example of how I use a dictionary with an update cursor:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# use a dictionary to populate a field&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; time&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; smtplib&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sys&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; inspect&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os


arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'J:\MayorsMap\AGRC_DownLoads\Parcels_SaltLake.gdb'&lt;/SPAN&gt;
ws &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace
source &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'{}\ParcelInfo'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ws&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
tableFields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'parcel_id'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OwnerType'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
target &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'{}\Parcels_CLipped'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ws&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
updateFields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'PARCEL_ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'OWN_TYPE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#create a dictionary of the {parcel_id:ownertype} from source...&lt;/SPAN&gt;
pidDict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;r&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; r &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;source&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;tableFields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;#start an edit session  on non-versioned egdb&lt;/SPAN&gt;
edit &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Editor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ws&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startOperation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#step through the tables and update&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#if the record has a valid site-id and a null site_guid&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#update the site_guid Both of these come from sites_1 feature class&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;target&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;updateFields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; updateRows&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; updateRow &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; updateRows&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
           keyValue &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; updateRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
           &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; keyValue &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; pidDict &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; updateRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
               updateRow&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pidDict&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;keyValue&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
               updateRows&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
           &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;pass&lt;/SPAN&gt;
        edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stopOperation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stopEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; Exception &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; err&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;err&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't worry about the try/except blocks but notice how I check to see if the keyValue is in the dictionary in line 30, nested witihin the for loop...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:48:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309320#M24125</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T14:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309321#M24126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am still not sure why it can't match my csv file to the objectid in the update cursor. I have tried you suggestion and it still not doing anything. I am leaving for the day and will start fresh tomorrow. Any other suggestions you have would be greatly appreciated. I did run the code in the python ide in ArcMap and I am getting no errors, it is just not finding my numbers in the objectid field. Tomorrow I may try a searchcursor and see if that finds it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kathy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2020 20:05:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309321#M24126</guid>
      <dc:creator>KathyJohnson1</dc:creator>
      <dc:date>2020-10-20T20:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309322#M24127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a good plan- it's not going anywhere and using a search cursor to trouble shoot you update cursor is good too.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2020 20:21:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309322#M24127</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-10-20T20:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309323#M24128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;I am wondering if the OID is coming in from the CSV as text and not an integer.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If OID from CSV is coming as text, than you would not get any matches, so it would be good to verify.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2020 20:27:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309323#M24128</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-10-20T20:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309324#M24129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the OID from the CSV is text, try:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;if csvdict.has_key(str(myOID)): # convert myOID to string
    print('found myOID for {}'.format(myOID))
    row[1] = csvdict[str(myOID)][0] # convert myOID to string
    cursor.updateRow(row)
#...
‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This section starts at line 69 in Joe's code, and use the correct indentation for this line.&amp;nbsp; Also, the values in csvdict are also text, so you need to convert them to the correct type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your OIDs start at 321972, you may wish to use a where clause so you are not checking unnecessary rows.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:48:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309324#M24129</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T14:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309325#M24130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I finally got it working, as it turned out it was the csv file being read in as text and not an integer. I also had to read my compkey in as an integer also. The code that changed was :&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;#Read the CSV File and store in csvdict dictionary
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;with &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;open&lt;/SPAN&gt;(CompKey, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'r'&lt;/SPAN&gt;) &lt;SPAN style="color: #000080; font-weight: bold;"&gt;as &lt;/SPAN&gt;f:
    reader = csv.reader(f)
&lt;SPAN style="color: #808080;"&gt;#skip header
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;_ = &lt;SPAN style="color: #000080;"&gt;next&lt;/SPAN&gt;(f)
    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #000080; font-weight: bold;"&gt;in &lt;/SPAN&gt;reader:
       key = [&lt;SPAN style="color: #000080;"&gt;int&lt;/SPAN&gt;(row[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;])]
&lt;SPAN style="color: #808080;"&gt;#THIS IS THE LINE THAT CHANGED. ########################
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;       &lt;/SPAN&gt;csvdict[&lt;SPAN style="color: #000080;"&gt;int&lt;/SPAN&gt;(&lt;SPAN style="color: #000080;"&gt;float&lt;/SPAN&gt;(row[&lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;]))] = [&lt;SPAN style="color: #000080;"&gt;int&lt;/SPAN&gt;(&lt;SPAN style="color: #000080;"&gt;float&lt;/SPAN&gt;(row[&lt;SPAN style="color: #0000ff;"&gt;1&lt;/SPAN&gt;]))]
       &lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;(csvdict)
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;print &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"That was the dictionary"

&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Thanks to all that helped.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:48:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309325#M24130</guid>
      <dc:creator>KathyJohnson1</dc:creator>
      <dc:date>2021-12-11T14:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309326#M24131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What a difference a day makes....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2020 14:04:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309326#M24131</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-10-21T14:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: OBJECTID in an UpdateCursor</title>
      <link>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309327#M24132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are so right! Thanks again for you help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2020 14:06:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/objectid-in-an-updatecursor/m-p/309327#M24132</guid>
      <dc:creator>KathyJohnson1</dc:creator>
      <dc:date>2020-10-21T14:06:48Z</dc:date>
    </item>
  </channel>
</rss>

