<?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: Create New Field Issues -- Specify LONG creates DOUBLE in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574098#M73485</link>
    <description>&lt;P&gt;Long field type I believe doesn't have precision or scale like (double or float) so the 20 would be ignored. Can you try without that?&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;arcpy.management.AddField(toFeatureClass, &lt;SPAN class=""&gt;"LOCALITY"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"LONG"&lt;/SPAN&gt;, "", &lt;SPAN class=""&gt;""&lt;/SPAN&gt;, &lt;SPAN class=""&gt;""&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Locality"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"NULLABLE"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"NON_REQUIRED"&lt;/SPAN&gt;)&lt;/DIV&gt;&lt;/DIV&gt;&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;</description>
    <pubDate>Thu, 09 Jan 2025 19:22:03 GMT</pubDate>
    <dc:creator>Laura</dc:creator>
    <dc:date>2025-01-09T19:22:03Z</dc:date>
    <item>
      <title>Create New Field Issues -- Specify LONG creates DOUBLE</title>
      <link>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574084#M73483</link>
      <description>&lt;P&gt;I am trying to create a new field in an Enterprise GDB ...&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the below and for some reason it creates the field with DOUBLE, 38, 8&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.management.AddField(toFeatureClass, "LOCALITY", "LONG", 20, "", "", "Locality", "NULLABLE", "NON_REQUIRED")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kapalczynski_0-1736448616759.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123053iF1F903C2E29FF82A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kapalczynski_0-1736448616759.png" alt="kapalczynski_0-1736448616759.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 18:50:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574084#M73483</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2025-01-09T18:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create New Field Issues -- Specify LONG creates DOUBLE</title>
      <link>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574093#M73484</link>
      <description>&lt;P&gt;I have a feeling specifying a field length is tripping it up. This is what Pro spits out as a default Python command for adding a "Long" field, you should be able to tweak this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.management.AddField(
    in_table=toFeatureClass,
    field_name="LOCALITY",
    field_type="LONG",
    field_precision=None,
    field_scale=None,
    field_length=None,
    field_alias="Locality",
    field_is_nullable="NULLABLE",
    field_is_required="NON_REQUIRED",
    field_domain=""
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Jan 2025 19:09:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574093#M73484</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2025-01-09T19:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create New Field Issues -- Specify LONG creates DOUBLE</title>
      <link>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574098#M73485</link>
      <description>&lt;P&gt;Long field type I believe doesn't have precision or scale like (double or float) so the 20 would be ignored. Can you try without that?&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;arcpy.management.AddField(toFeatureClass, &lt;SPAN class=""&gt;"LOCALITY"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"LONG"&lt;/SPAN&gt;, "", &lt;SPAN class=""&gt;""&lt;/SPAN&gt;, &lt;SPAN class=""&gt;""&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"Locality"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"NULLABLE"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"NON_REQUIRED"&lt;/SPAN&gt;)&lt;/DIV&gt;&lt;/DIV&gt;&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;</description>
      <pubDate>Thu, 09 Jan 2025 19:22:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574098#M73485</guid>
      <dc:creator>Laura</dc:creator>
      <dc:date>2025-01-09T19:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create New Field Issues -- Specify LONG creates DOUBLE</title>
      <link>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574107#M73486</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/633156"&gt;@kapalczynski&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It appears that the long will be created as a double if the precision is 11 or more from this documentation here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-field.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-field.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For a field with a scale of 0, use a long or short integer field type. When creating a long integer field, specify a precision of 10 or less, or the field may be created as a double.&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 19:35:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574107#M73486</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2025-01-09T19:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create New Field Issues -- Specify LONG creates DOUBLE</title>
      <link>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574119#M73487</link>
      <description>&lt;P&gt;Thank you all for your comments...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So if I need the field to carry 15 digits I have to make it a DOUBLE with PRECISION of 15 and no DECIMALS?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 19:50:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574119#M73487</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2025-01-09T19:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create New Field Issues -- Specify LONG creates DOUBLE</title>
      <link>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574136#M73491</link>
      <description>&lt;P&gt;You must use Double.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;arcpy.management.AddField(
    in_table=toFeatureClass, 
    field_name="LOCALITY", 
    field_type="DOUBLE",  # Use DOUBLE for high-precision numbers
    field_precision=15,   # Total number of digits
    field_scale=0,        # No decimal places
    field_alias="Locality", 
    field_is_nullable="NULLABLE", 
    field_is_required="NON_REQUIRED"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 20:13:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574136#M73491</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2025-01-09T20:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create New Field Issues -- Specify LONG creates DOUBLE</title>
      <link>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574167#M73492</link>
      <description>&lt;P&gt;As I needed 15 digits I had to create a DOULBE with 15 digits and 0 decimal places as LONG only holds 10 digits.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 21:17:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-new-field-issues-specify-long-creates/m-p/1574167#M73492</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2025-01-09T21:17:40Z</dc:date>
    </item>
  </channel>
</rss>

