<?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: Inersting values in arcgis table by trigger and increasing the object index value in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/inserting-values-in-arcgis-table-by-trigger-and/m-p/71224#M2767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried using the &lt;STRONG&gt;sde.next_id &lt;/STRONG&gt;procedure inside your trigger to obtain the object ID (instead of MAX() + 1)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should ensure you get an appropriate object ID while also maintaining the correct state in the system tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Apr 2015 22:14:46 GMT</pubDate>
    <dc:creator>ErinBrimhall</dc:creator>
    <dc:date>2015-04-17T22:14:46Z</dc:date>
    <item>
      <title>Inserting values in arcgis table by trigger and increasing the object id index value</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/inserting-values-in-arcgis-table-by-trigger-and/m-p/71223#M2766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;We have setup a feature class for road drains. The feature class is published as a feature service and inspectors are cleaning the drains regularly. Once the drain was cleaned, the inspection is registered via Collector for ArcGIS in the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To simplify the process we have setup &lt;STRONG&gt;one&lt;/STRONG&gt; field which need to be changed to register the inspection. Once the field value is changed, the database triggers ensures that some additional fields in the feature class are modified. This works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also setup a relational table, let’s say “inspection log”, which holds records of particular inspections. Once the inspection is registered, the trigger also adds the inspection record to the “inspection log” table. However, to enter a record I need to enter a &lt;STRONG&gt;unique objectid &lt;/STRONG&gt;to inspection log table (the objectid must be entered explicitly, it is not added automatically), which I do by determining the current max &lt;STRONG&gt;objectid &lt;/STRONG&gt;and increasing it by one. This works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I later try to enter a record to inspection table directly from ArcMap, the insert fails, because the next available &lt;STRONG&gt;objectid&lt;/STRONG&gt; known to ArcGIS was used when entering the records by trigger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way how to update the value of next available &lt;STRONG&gt;objectid &lt;/STRONG&gt;in arcgis system tables. I found a column named &lt;STRONG&gt;last_id&lt;/STRONG&gt; in feature class’ &lt;STRONG&gt;i-Table, &lt;/STRONG&gt;but it seems, that altering the value do not make any difference when entering new record.&lt;/P&gt;&lt;P&gt;I know it is not recommended to alter system tables directly, but I would appreciate help, if somebody knows the safe and correct way to do this with the triggers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just for a record, we are using PostgreSQL as DBMS and version 10.3 of ArcGIS software.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 12:04:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/inserting-values-in-arcgis-table-by-trigger-and/m-p/71223#M2766</guid>
      <dc:creator>MartinSirkovsky</dc:creator>
      <dc:date>2015-04-17T12:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Inersting values in arcgis table by trigger and increasing the object index value</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/inserting-values-in-arcgis-table-by-trigger-and/m-p/71224#M2767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried using the &lt;STRONG&gt;sde.next_id &lt;/STRONG&gt;procedure inside your trigger to obtain the object ID (instead of MAX() + 1)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should ensure you get an appropriate object ID while also maintaining the correct state in the system tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 22:14:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/inserting-values-in-arcgis-table-by-trigger-and/m-p/71224#M2767</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2015-04-17T22:14:46Z</dc:date>
    </item>
  </channel>
</rss>

