<?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>idea Environment setting to default Integer to Long not BigInteger in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idi-p/1385335</link>
    <description>&lt;P&gt;When importing data from geopackage or sqlite any field defined as Integer in the DDL gets cast to &lt;STRONG&gt;BigInteger&lt;/STRONG&gt; instead of &lt;STRONG&gt;(Long) Integer&lt;/STRONG&gt;. This is a new incompatible behaviour since &lt;STRONG&gt;BigIntegers&lt;/STRONG&gt; were included (ArcPro 3.2?). There are several tools that do not work with BigIntegers such as RelationshipClasses.&lt;/P&gt;&lt;P&gt;It would be helpful if there was a switch to turn off this unwelcome enhancement. &lt;EM&gt;&lt;STRONG&gt;There is a switch in Options/Map and Scene - &lt;U&gt;but it doesn't work&lt;/U&gt;.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The only way to fix the problem is to define a FieldMapping on every copy operation and there are many of these that do not have FieldMapping as a parameter.&lt;/P&gt;&lt;P&gt;If the field is readonly such as OBJECTID then it cannot be changed at all. I see another user has used &lt;U&gt;FME&lt;/U&gt; to fix this.&lt;/P&gt;&lt;P&gt;This is like a reverse single precision / double precision incompatibility!&lt;/P&gt;&lt;P&gt;Maybe a switch somewhere in the settings or the environment settings to retrofit a fix?&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 22:40:08 GMT</pubDate>
    <dc:creator>KimOllivier</dc:creator>
    <dc:date>2024-05-23T22:40:08Z</dc:date>
    <item>
      <title>Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idi-p/1385335</link>
      <description>&lt;P&gt;When importing data from geopackage or sqlite any field defined as Integer in the DDL gets cast to &lt;STRONG&gt;BigInteger&lt;/STRONG&gt; instead of &lt;STRONG&gt;(Long) Integer&lt;/STRONG&gt;. This is a new incompatible behaviour since &lt;STRONG&gt;BigIntegers&lt;/STRONG&gt; were included (ArcPro 3.2?). There are several tools that do not work with BigIntegers such as RelationshipClasses.&lt;/P&gt;&lt;P&gt;It would be helpful if there was a switch to turn off this unwelcome enhancement. &lt;EM&gt;&lt;STRONG&gt;There is a switch in Options/Map and Scene - &lt;U&gt;but it doesn't work&lt;/U&gt;.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The only way to fix the problem is to define a FieldMapping on every copy operation and there are many of these that do not have FieldMapping as a parameter.&lt;/P&gt;&lt;P&gt;If the field is readonly such as OBJECTID then it cannot be changed at all. I see another user has used &lt;U&gt;FME&lt;/U&gt; to fix this.&lt;/P&gt;&lt;P&gt;This is like a reverse single precision / double precision incompatibility!&lt;/P&gt;&lt;P&gt;Maybe a switch somewhere in the settings or the environment settings to retrofit a fix?&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 22:40:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idi-p/1385335</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2024-05-23T22:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1385415#M28629</link>
      <description>&lt;P&gt;Thanks Kimo I'll get this to the right team.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 14:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1385415#M28629</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2024-02-22T14:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1392537#M28896</link>
      <description>&lt;P&gt;Completely agree&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1237"&gt;@KimOllivier&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In ArcGIS Pro 3.2, at least tools like &lt;STRONG&gt;Copy Features&lt;/STRONG&gt;, &lt;STRONG&gt;Feature class to Geodatabase, etc...&lt;/STRONG&gt; should honor the version of the pre-created target File Geodatabase.&lt;/P&gt;&lt;P&gt;If the pre-created target File Geodatabase version is 10.0 or below then data conversion/import tools should not introduce the new features of ArcGIS Pro 3.2 e.g., 64-bit OID, Big integer, Timestamp offset,&amp;nbsp;Date only,&amp;nbsp;Time only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/187446"&gt;@SirishByreddy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 14:24:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1392537#M28896</guid>
      <dc:creator>Ranga_Tolapi</dc:creator>
      <dc:date>2024-03-07T14:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1396634#M28992</link>
      <description>&lt;P&gt;Related is this bug that is currently being investigated:&amp;nbsp;&lt;A href="https://support.esri.com/en-us/bug/geopackage-feature-class-objectids-are-read-as-64bit-in-bug-000164015" target="_blank"&gt;https://support.esri.com/en-us/bug/geopackage-feature-class-objectids-are-read-as-64bit-in-bug-000164015&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 16:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1396634#M28992</guid>
      <dc:creator>KoryKramer</dc:creator>
      <dc:date>2024-03-15T16:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1419704#M29922</link>
      <description>&lt;P&gt;ArcPro and AGOL&amp;nbsp; also do not work well with Big integer. We don't have anything that is a big integer and only use long. If you look at the layer in ArcCatelog it shows as long integer but the data design view of the same layer shows it as big integer. If we export to AGOL it gives a warning message about big integer and sure enough, it is big integer in AGOL. I guess the bug is in ArcPro 3.2.2. Please fix&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Big Integer bug.PNG" style="width: 956px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/103294i2972FD0FE4E15566/image-size/large?v=v2&amp;amp;px=999" role="button" title="Big Integer bug.PNG" alt="Big Integer bug.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MelanieWawryk_0-1715036790341.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/103295iB0171D3299BE4985/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MelanieWawryk_0-1715036790341.png" alt="MelanieWawryk_0-1715036790341.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 23:09:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1419704#M29922</guid>
      <dc:creator>MelanieWawryk</dc:creator>
      <dc:date>2024-05-06T23:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1478112#M30377</link>
      <description>&lt;P&gt;Not fixed in 3.3. Ah well, back to 3.1 so that I can attempt to port workflows from ArcMap!&lt;/P&gt;&lt;P&gt;There is a setting in Options/Map and Scene - but it doesn't work for me. [Edit: it casts BigInteger to Double, not Long so cannot be used as a key]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="settings.png" style="width: 981px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/105261i49AFE7563DCEE675/image-size/large?v=v2&amp;amp;px=999" role="button" title="settings.png" alt="settings.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="query_layer.png" style="width: 672px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/105262iE0A8167E094DF1BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="query_layer.png" alt="query_layer.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2024 23:04:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1478112#M30377</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2024-11-02T23:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1535654#M32005</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1237"&gt;@KimOllivier&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After delving deeper into the issue of INTEGER vs BIGINT, I discovered the following information. ArcGIS Pro didn't support 64-bit integers until ArcGIS Pro 3.2. It's important to note that GeoPackage uses SQLite under the covers, and INT and INTEGER datatypes in SQLite have always been 64-bit. Consequently, with ArcGIS Pro 3.2 now supporting 64-bit integers using BIGINT and considering that an INTEGER is 64-bit in a GeoPackage, the columns are cast to BIGINT. From a technical standpoint, this behavior is correct, which could argue against it being classified as a bug. However, I believe a more effective approach would involve inspecting the column values before automatically casting them to BIGINT. For instance, ArcGIS could examine the values for all INTEGER columns first to determine if casting to BIGINT is necessary. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's an example query: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT * FROM MyRoads&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;WHERE MyRoads&lt;/SPAN&gt;&lt;SPAN&gt;.LINK&lt;/SPAN&gt;&lt;SPAN&gt;_ID &amp;lt; -2147483648 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;OR MyRoads&lt;/SPAN&gt;&lt;SPAN&gt;.LINK&lt;/SPAN&gt;&lt;SPAN&gt;_ID &amp;gt; 2147483647; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the query returns nothing, then casting to INTEGER would be more appropriate than using BIGINT.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 20:03:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1535654#M32005</guid>
      <dc:creator>DannyMac</dc:creator>
      <dc:date>2024-09-05T20:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1535759#M32009</link>
      <description>&lt;P&gt;Thanks for that explanation. It does show why it is happening. But the option switch says "to use field types that are compatible with ArcGISPro 3.1", which are long integer. So even if it is correct to move 64 bit fields in Sqlite to BigInteger they do not work in Pro for many functions if they are cast that way. This must be a problem with other databases in Enterprise too. I suspect they had a very narrow view of this problem when implementing the option.&lt;/P&gt;&lt;P&gt;All I am asking for is for the switch to work everywhere. [Edit. It only works inside ArcGISPro, you can use the switch in &lt;STRONG&gt;arcpy.env.useCompatibleFieldTypes = True&lt;/STRONG&gt; when running scripts outside Pro. But a cast to Double is not useful for me.]&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2024 23:02:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1535759#M32009</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2024-11-02T23:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1535952#M32014</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1237"&gt;@KimOllivier&lt;/a&gt;&amp;nbsp; I currently have an enterprise support ticket open for this issue, and I've referenced your post in my ticket to ensure that they are aware that I'm not the only one affected by this unexpected change. For us, it means we either need to update all of our application code to utilize BigInt, or we can modify all the columns after importing features and change them back to Integer. At the moment, we are choosing the latter option because none of the columns in our database would require a BigInt data type.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 15:37:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1535952#M32014</guid>
      <dc:creator>DannyMac</dc:creator>
      <dc:date>2024-09-06T15:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1544850#M32324</link>
      <description>&lt;P&gt;Just to chime in here.&amp;nbsp; It appears BigInt is not a compatible sort_field in tools such as ExportFeatures and PointsToLine (only tested in arcpy), which is problematic for many of our script tools.&amp;nbsp; Hopefully this is resolved quickly.&lt;/P&gt;&lt;PRE&gt;ERROR 003911:&lt;SPAN class=""&gt; The field is not of type SHORT | LONG | FLOAT | DOUBLE | TEXT | DATE | XML | OBJECTID&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 16:53:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1544850#M32324</guid>
      <dc:creator>Marshal</dc:creator>
      <dc:date>2024-10-02T16:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1554943#M32652</link>
      <description>&lt;P&gt;Even if the policy is correctly set for casting the ambiguous Integer type I still need a solution that works for me. I can see that computing has evolved from 16 to 32 to 64 bit integers and some are defined as signed and unsigned. I have seen LONG, MEDINT, INTEGER and SHORT as well as the new BigInteger to try to extend the meaning of 'LONG' which in 32 bit days meant only 32 bits. To keep backward compatibility the temptation is to reuse 'Long' for 64 bit when using a 64 bit compiler.&lt;/P&gt;&lt;P&gt;I was interested to see that MEDINT was interpreted as Long and INTEGER as BigInteger going from a gpkg to a filegeodatabase. So redefining the gpkg field type might be a good workaround that avoids having to explicitly cast the fieldtype using a fieldmappings parameter with &lt;STRONG&gt;ExportFeatures_conversion()&lt;/STRONG&gt; replacing &lt;STRONG&gt;CopyFeatures()&lt;/STRONG&gt;. [note that sqlite does not care what you call it in the DDL, they are always 64 bit integers internally]&lt;/P&gt;&lt;P&gt;The small print in the help also explains why the option setting in Options in ArcGISPro does not work for me. Because if running a script outside ArcGISPro in the command line you have to set the options in the arcpy environment. arcpy.env. But &lt;STRONG&gt;Double&lt;/STRONG&gt; is useless for me. I want to use the field as an indexed key so it has to be some sort of integer. Insert below:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;useCompatibleFieldTypes&lt;/STRONG&gt;&lt;DIV class=""&gt;(Read and Write)&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Specifies whether field types that are compatible with &lt;SPAN class=""&gt;ArcGIS Pro 3.1&lt;/SPAN&gt; will be used. This setting relates to the use of the Date Only, Time Only, Timestamp Offset, and Big Integer field types in CSV tables and unregistered database tables with tools that create layers or table views.&lt;/P&gt;&lt;P&gt;When set to &lt;SPAN class=""&gt;True&lt;/SPAN&gt;, a layer or table view created from these sources will use field types compatible with &lt;SPAN class=""&gt;ArcGIS Pro 3.1&lt;/SPAN&gt;. Date Only, Time Only, and Timestamp Offset fields will be displayed as Date fields, and Big Integer fields will be displayed as &lt;EM&gt;&lt;STRONG&gt;Double&lt;/STRONG&gt;&lt;/EM&gt; fields. When set to &lt;SPAN class=""&gt;False&lt;/SPAN&gt;, all original data source field types will be used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;H5&gt;Note:&lt;/H5&gt;&lt;P&gt;This property is applicable when used from stand-alone &lt;SPAN class=""&gt;Python&lt;/SPAN&gt; or for a geoprocessing service. When used in &lt;SPAN class=""&gt;ArcGIS Pro&lt;/SPAN&gt;, this property will always match the &lt;A href="https://pro.arcgis.com/en/pro-app/3.3/help/mapping/properties/default-settings-for-new-maps-and-scenes.htm#ESRI_SECTION1_856A5CFA37884F889D2BBC0FC31315A2" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;Use field types that are compatible with ArcGIS Pro 3.1 and earlier releases when adding query layers and text files&lt;/SPAN&gt;&lt;/A&gt; option.&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A better option I have implemented is to replace &lt;STRONG&gt;CopyFeatures_management()&lt;/STRONG&gt; with my own function &lt;STRONG&gt;CopyFeaturesLong()&lt;/STRONG&gt; that looks for any &lt;STRONG&gt;BigInteger&lt;/STRONG&gt; arcpy interpretations and &lt;U&gt;keeps them as a compatible Integer, not a Double.&lt;/U&gt; Here it is if you want to use it. There will need to be a similar function to replace &lt;STRONG&gt;CopyRows(). &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def CopyFeaturesLong(input_fc, output_fc):
    """CopyFeatures replacement
    to ensure every BigInteger is mapped to Long
    with a fieldmappings parameter using arcpy.conversion.ExportFeatures()
    with a bit of help from copilot!
    full paths to featureclasses assumed """

    # Create FieldMappings and FieldMap objects
    field_mappings = arcpy.FieldMappings()
    # List of fields to process
    # it would be nice if objectid and shape could be excluded easily
    fields = arcpy.ListFields(input_fc)

    for field in fields:
        if field.type not in ('OID', 'Geometry'): # not allowed in fieldmappings
            field_map = arcpy.FieldMap() # new for each field
            field_map.addInputField(input_fc, field.name)
            # Check if the field type is BigInteger and change to Long
            field_name = field_map.outputField
            if field_name.type == 'BigInteger':
                field_name.type = 'Long'
            field_map.outputField = field_name
            # Add the FieldMap to the FieldMappings object
            field_mappings.addFieldMap(field_map)

    # Use ExportFeatures to apply the field mappings and create the output feature class
    arcpy.conversion.ExportFeatures(input_fc, output_fc, field_mapping=field_mappings)
    if debug:
        for fld in arcpy.ListFields(output_fc):
            print(fld.name,fld.type)
        print(f"{output_fc} Feature class successfully exported with updated field types!")

    return True
def CopyRowsLong(input_tab, output_tab):
    """CopyRows replacement
    to ensure every BigInteger is mapped to Long
    with a fieldmappings parameter using arcpy.conversion.ExportTable()
    with a bit of help from copilot!
    full paths to featureclasses assumed """

    # Create FieldMappings and FieldMap objects
    field_mappings = arcpy.FieldMappings()
    # List of fields to process
    # it would be nice if objectid and shape could be excluded easily
    fields = arcpy.ListFields(input_tab)

    for field in fields:
        if field.type not in ('OID', 'Geometry'): # not allowed in fieldmappings
            field_map = arcpy.FieldMap() # new for each field
            field_map.addInputField(input_tab, field.name)
            # Check if the field type is BigInteger and change to Long
            field_name = field_map.outputField
            if field_name.type == 'BigInteger':
                field_name.type = 'Long'
            field_map.outputField = field_name
            # Add the FieldMap to the FieldMappings object
            field_mappings.addFieldMap(field_map)

    # Use ExportFeatures to apply the field mappings and create the output feature class
    arcpy.conversion.ExportTable(input_tab, output_tab, field_mapping=field_mappings)
    if debug:
        for fld in arcpy.ListFields(output_tab):
            print(fld.name,fld.type)
        print(f"{output_tab} Table class successfully exported with updated field types!")

    return True&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2024 23:19:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1554943#M32652</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2024-11-02T23:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1564489#M33082</link>
      <description>&lt;P&gt;You may need to fix a bug(?) that adds a blank field to the end of the arcpy.ListFields(fc) command.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;fields = arcpy.ListFields(input_fc)
    print(f"L42 {[f.name for f in fields]}")
    for field in fields:
        if field.type not in ('OID', 'Geometry'): # not allowed in fieldmappings
            if field.name: # very strange blank name added to list by Esri
                field_map = arcpy.FieldMap() # new for each field
                print(f"L46 {input_fc},&amp;lt;{field.name}&amp;gt;")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Dec 2024 23:35:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1564489#M33082</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2024-12-03T23:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Environment setting to default Integer to Long not BigInteger</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1602998#M34406</link>
      <description>&lt;P&gt;But there is another&amp;nbsp; problem not covered by my workaround. OBJECTID can be 32 or 64 bit as well. This is much harder to change and even detect. The type is "ÓID" for both (not helpful) but you can find out the length is 4 or 8.&lt;/P&gt;&lt;P&gt;If the table is empty you can edit the field schema by hand to fix it, but I don't know how to do it in a script.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 21:34:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/environment-setting-to-default-integer-to-long-not/idc-p/1602998#M34406</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2025-04-04T21:34:13Z</dc:date>
    </item>
  </channel>
</rss>

