<?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 Error using AddFields_management: Invalid Long type in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-using-addfields-management-invalid-long-type/m-p/114445#M8944</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to add a couple of fields using the "AddFields_management" from the arcpy that comes with ArcGIS Pro. But when I try to do so, I get an error message that tells me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;arcgisscripting.ExecuteError: ERROR 000378: Invalid Long type.&lt;BR /&gt;ERROR 000852: Cannot add field CLASS_ID to F:\Projects\root@Demo2.sde/Demo2.ROOT.StructureLine&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What I'm, trying to do is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;add_fields &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;
add_fields&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'CLASS_ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'LONG'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CLASS_ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&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;
add_fields&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SUBTYPE_ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SHORT'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SUBTYPE_ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&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;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddFields_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"F:\Projects\root@Demo2.sde/Demo2.ROOT.StructureLine"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; add_fields&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm lost here. I have no idea why I'm not able to add this field. Interesting: When I'm going to add those fields sequentially using arcpy.AddField_management everything works as expected. Unfortunatelly this is not an option, since I'm going to add a lot of fields to that table (more than 40), which costs a lot of time when I'm doing it field after field (more than a hour per table!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any ideas how to use arcpy.AddFields_management properly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Karl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 06:46:57 GMT</pubDate>
    <dc:creator>KarlHuber</dc:creator>
    <dc:date>2021-12-11T06:46:57Z</dc:date>
    <item>
      <title>Error using AddFields_management: Invalid Long type</title>
      <link>https://community.esri.com/t5/python-questions/error-using-addfields-management-invalid-long-type/m-p/114445#M8944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to add a couple of fields using the "AddFields_management" from the arcpy that comes with ArcGIS Pro. But when I try to do so, I get an error message that tells me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;arcgisscripting.ExecuteError: ERROR 000378: Invalid Long type.&lt;BR /&gt;ERROR 000852: Cannot add field CLASS_ID to F:\Projects\root@Demo2.sde/Demo2.ROOT.StructureLine&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;What I'm, trying to do is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;add_fields &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;
add_fields&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'CLASS_ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'LONG'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CLASS_ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&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;
add_fields&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SUBTYPE_ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SHORT'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SUBTYPE_ID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&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;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddFields_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"F:\Projects\root@Demo2.sde/Demo2.ROOT.StructureLine"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; add_fields&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm lost here. I have no idea why I'm not able to add this field. Interesting: When I'm going to add those fields sequentially using arcpy.AddField_management everything works as expected. Unfortunatelly this is not an option, since I'm going to add a lot of fields to that table (more than 40), which costs a lot of time when I'm doing it field after field (more than a hour per table!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any ideas how to use arcpy.AddFields_management properly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Karl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:46:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-using-addfields-management-invalid-long-type/m-p/114445#M8944</guid>
      <dc:creator>KarlHuber</dc:creator>
      <dc:date>2021-12-11T06:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Error using AddFields_management: Invalid Long type</title>
      <link>https://community.esri.com/t5/python-questions/error-using-addfields-management-invalid-long-type/m-p/114446#M8945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Other than 3 of the parameters that the single Add Field enables you to set explicitly, the AddFieldSS set those three to default values, innocuous selections.&amp;nbsp; The only thing that I notice is that you are working on a non-local file (your sde path).&amp;nbsp; Could you see whether the same procedure of adding fields of the same type to a locally stored geodatabase is successful or not.&amp;nbsp; It may not be what is being added that is the issue but where it is being added.&amp;nbsp; This is even though you indicate that a single add field works with the file you are using.&amp;nbsp; Perhaps AddFields has something else going on (or it is a bug)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2018 03:25:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-using-addfields-management-invalid-long-type/m-p/114446#M8945</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-03-01T03:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error using AddFields_management: Invalid Long type</title>
      <link>https://community.esri.com/t5/python-questions/error-using-addfields-management-invalid-long-type/m-p/114447#M8946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan, actually I'm working on a SDE, trying to setup an Utility Network. I'll check the issue with my staging file geodatabase and give you some feedback soon...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2018 07:32:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-using-addfields-management-invalid-long-type/m-p/114447#M8946</guid>
      <dc:creator>KarlHuber</dc:creator>
      <dc:date>2018-03-01T07:32:48Z</dc:date>
    </item>
  </channel>
</rss>

