<?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: Query max ObjectID from base and Adds tables in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/query-max-objectid-from-base-and-adds-tables/m-p/5860#M254</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not familiar with SDE in Oracle so I can't comment specifically on that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I can tell you that an OBJECTID is not guaranteed to be larger than the previously added record. If multiple processes are writing to the table, one process could reserve a slice of OBJECTIDs for itself. Then, if a second process starts adding records before the first one is done, the lower OBJECTIDs of the first process will be intermixed with the higher OBJECTIDs of the second process.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Jul 2017 14:56:16 GMT</pubDate>
    <dc:creator>DavidBlanchard</dc:creator>
    <dc:date>2017-07-27T14:56:16Z</dc:date>
    <item>
      <title>Query max ObjectID from base and Adds tables</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/query-max-objectid-from-base-and-adds-tables/m-p/5859#M253</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" style="background: #f6f6f6; border-width: 0px 0px 0px 2px; border-style: initial initial initial solid; border-color: initial initial initial #cccccc; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P style="border: 0px; font-weight: inherit;"&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/198764-is-it-possible-to-append-objectid-using-fieldmappings#comment" target="_blank"&gt;Joshua Bixby wrote&lt;/A&gt;:&lt;/P&gt;&lt;P style="border: 0px; font-weight: inherit;"&gt;Blake, why do you want "current RowID"?&amp;nbsp; Or, are you after the highest/largest ObjectID in use?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I assumed they would be the same. Is it possible for a&amp;nbsp;new feature to get an ObjectID lower than the highest ObjectID already assigned?&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;My case is that we're trying to build a database trigger &lt;SPAN style="font-size: 11px;"&gt;(yeah, I know, probably shaking your head already)&lt;/SPAN&gt; that will assign our organization's custom "GlobalID" we call EID (for Enterprise ID). It's just a long integer assigned from a sequence. The trigger calling the sequence is built on the Adds table. When a record is created in the Adds table, it generates an EID value if:&lt;/P&gt;&lt;UL style="background-color: #ffffff; border: 0px; padding: 0px 0px 0px 30px;"&gt;&lt;LI style="border: 0px; font-weight: inherit; margin: 0.5ex 0px;"&gt;Current EID is Null (for new records)&lt;/LI&gt;&lt;LI style="border: 0px; font-weight: inherit; margin: 0.5ex 0px;"&gt;If new ObjectID &amp;gt; max ObjectID (for features that are copy/pasted or split)&lt;/LI&gt;&lt;/UL&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;The extra catch I ran into was that finding the max ObjectID needs to look at both the Base table and the Adds table or else a brand new feature will get a new EID every time it's modified until it's been compressed to the Base table.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;My Original idea was to just query the base table and adds table in the trigger but apparently that causes a "mutation" error in Oracle. So my current solution is a function that queries the base and adds tables for the max ObjectID.&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;CREATE&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;OR&lt;/SPAN&gt; REPLACE &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;FUNCTION&lt;/SPAN&gt; GIS&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;MaxObjectID&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;p_owner VARCHAR2&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;,&lt;/SPAN&gt; p_tablename VARCHAR2&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;RETURN&lt;/SPAN&gt; NUMBER &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;IS&lt;/SPAN&gt;
max_objectid NUMBER&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;
regid NUMBER&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;
vc2SqlStr&amp;nbsp;&amp;nbsp; VARCHAR2&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;1000&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;

&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;BEGIN&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;BEGIN&lt;/SPAN&gt;
&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;select&lt;/SPAN&gt; tr&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;REGISTRATION_ID 
&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;into&lt;/SPAN&gt; regid
&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;from&lt;/SPAN&gt; SDE&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;TABLE_REGISTRY tr
&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;where&lt;/SPAN&gt; tr&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;OWNER &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; p_owner &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;and&lt;/SPAN&gt; tr&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;TABLE_NAME &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; p_tablename&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXCEPTION &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;WHEN&lt;/SPAN&gt; OTHERS &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;THEN&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; regid :&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: #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;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;END&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; vc2SqlStr :&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: #669900; border: 0px; font-weight: inherit;"&gt;'select NVL(max(objectid), 0) from (
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select max(OBJECTID) as objectid from '&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;||&lt;/SPAN&gt;p_owner&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: #669900; border: 0px; font-weight: inherit;"&gt;'.'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;||&lt;/SPAN&gt;p_tablename&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;||&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;' union all 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select max(OBJECTID) as objectid from '&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;||&lt;/SPAN&gt;p_owner&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: #669900; border: 0px; font-weight: inherit;"&gt;'.A'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;||&lt;/SPAN&gt;regid&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;||&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #669900; 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; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;BEGIN&lt;/SPAN&gt;
&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;EXECUTE&lt;/SPAN&gt; IMMEDIATE vc2SqlStr &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;INTO&lt;/SPAN&gt; max_objectid&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; EXCEPTION &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;WHEN&lt;/SPAN&gt; OTHERS &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;THEN&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max_objectid :&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: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;-&lt;/SPAN&gt;&lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;END&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;RETURN&lt;/SPAN&gt; max_objectid&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;END&lt;/SPAN&gt; MaxObjectID&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;&lt;SPAN class="" style="border-width: 0px 1px 0px 0px; border-style: initial solid initial initial; border-color: initial #999999 initial initial; font-weight: inherit;"&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;This function is called in the trigger.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;BEFORE &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;ON&lt;/SPAN&gt; WS&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;A658&amp;nbsp; &lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit;"&gt;-- Adds Table&lt;/SPAN&gt;
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;for each row&lt;/SPAN&gt;
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;declare&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; max_objectid WS&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;A658&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;objectid&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: #0077aa; border: 0px; font-weight: inherit;"&gt;type&lt;/SPAN&gt;:&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: #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: #0077aa; border: 0px; font-weight: inherit;"&gt;begin&lt;/SPAN&gt;
max_objectid :&lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;MaxObjectID&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;'WS'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;,&lt;/SPAN&gt; &lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;'HYDRANT_PNT'&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; &lt;SPAN class="" style="color: slategray; border: 0px; font-weight: inherit;"&gt;-- Base Table Owner, Name&lt;/SPAN&gt;
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;if&lt;/SPAN&gt; max_objectid &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &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: #990000; border: 0px; font-weight: inherit;"&gt;1&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;and&lt;/SPAN&gt; &lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;:new&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;eid &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;is&lt;/SPAN&gt; &lt;SPAN class="" style="color: #990000; border: 0px; font-weight: inherit;"&gt;NULL&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;or&lt;/SPAN&gt; :new&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;objectid &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;&amp;gt;&lt;/SPAN&gt; max_objectid&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;then&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;SELECT&lt;/SPAN&gt; HYDRANT_EID_SEQ&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;NEXTVAL &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;INTO&lt;/SPAN&gt; :NEW&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;EID &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;FROM&lt;/SPAN&gt; DUAL&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;end&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;end&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;;&lt;/SPAN&gt;&lt;SPAN class="" style="border-width: 0px 1px 0px 0px; border-style: initial solid initial initial; border-color: initial #999999 initial initial; font-weight: inherit;"&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;So I'm looking for a better way to determine the max ObjectID (or just whether a feature is new). I was hoping the &amp;lt;owner&amp;gt;.R&amp;lt;registration_id&amp;gt; sequence would be the magic bullet I could call &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;A href="https://asktom.oracle.com/pls/apex/f?p=100:11:0::NO::P11_QUESTION_ID:4245421000346226872" rel="nofollow noopener noreferrer" target="_blank"&gt;CURRVAL&lt;/A&gt;&lt;/SPAN&gt; on but the value it returns does not seem to be correct.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Also paging&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/34262" target="_blank"&gt;David Blanchard&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:14:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/query-max-objectid-from-base-and-adds-tables/m-p/5859#M253</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-10T20:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Query max ObjectID from base and Adds tables</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/query-max-objectid-from-base-and-adds-tables/m-p/5860#M254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not familiar with SDE in Oracle so I can't comment specifically on that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I can tell you that an OBJECTID is not guaranteed to be larger than the previously added record. If multiple processes are writing to the table, one process could reserve a slice of OBJECTIDs for itself. Then, if a second process starts adding records before the first one is done, the lower OBJECTIDs of the first process will be intermixed with the higher OBJECTIDs of the second process.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jul 2017 14:56:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/query-max-objectid-from-base-and-adds-tables/m-p/5860#M254</guid>
      <dc:creator>DavidBlanchard</dc:creator>
      <dc:date>2017-07-27T14:56:16Z</dc:date>
    </item>
  </channel>
</rss>

