<?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: Use Oracle UPDATE TRIGGER instead of attribute assistant in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861006#M5709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No we didn't yet. When we started working with attribute assistant, ArcGIS Pro didn't have this option yet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our experience in using the attribute assistant is that not all users&amp;nbsp;always use the extension.&amp;nbsp;Having a server side solution gives more guarantees.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Apr 2018 15:01:57 GMT</pubDate>
    <dc:creator>Bart-JanSchoenmakers</dc:creator>
    <dc:date>2018-04-30T15:01:57Z</dc:date>
    <item>
      <title>Use Oracle UPDATE TRIGGER instead of attribute assistant</title>
      <link>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861001#M5704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have an Geodatabase implemented in Oracle and are using the Attribute Assistant to update some attributes, with values based on other layers, when editing our data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use of the attribute assistant is a bit tricky since people sometimes forget to include the necessary tables in their project and since half a year are we also use ArcGIS Pro, which doesn’t have an attribute assistant yet.&lt;/P&gt;&lt;P&gt;It seems to me that the same functionality can also be implemented as an Oracle Update Trigger. &amp;nbsp;When using the SQL ST_Geometry functions it must be possible obtaining the attributes of related layers (sde.st_intersects).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before I start to test and develop a trigger I would like to know if some people use Oracle triggers as an alternative for the Attribute Assistant? If so what are the difficulties and limitations?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2018 16:36:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861001#M5704</guid>
      <dc:creator>Bart-JanSchoenmakers</dc:creator>
      <dc:date>2018-03-19T16:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Use Oracle UPDATE TRIGGER instead of attribute assistant</title>
      <link>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861002#M5705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I managed to implement an Oracle Trigger using the different SDE GEOMETRY functions.&lt;/P&gt;&lt;P&gt;Here follows some of the code for anyone who would like to do the same:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;create&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;or&lt;/SPAN&gt; replace &lt;SPAN class="keyword token"&gt;TRIGGER&lt;/SPAN&gt; TRG_FEATCLASS_TABLE_NAME
BEFORE &lt;SPAN class="keyword token"&gt;UPDATE&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt; FEATCLASS_TABLE_NAME 

REFERENCING NEW &lt;SPAN class="keyword token"&gt;AS&lt;/SPAN&gt; NEW OLD &lt;SPAN class="keyword token"&gt;AS&lt;/SPAN&gt; OLD 
&lt;SPAN class="keyword token"&gt;FOR EACH ROW&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;DECLARE&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;-- VARIABLE&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; v_aux_xcoord NUMBER&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;20&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; v_aux_ycoord NUMBER&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;20&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; v_aux_SHAPE sde&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;st_geometry&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; v_aux_intersect_value &lt;SPAN class="keyword token"&gt;varchar&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;12&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;BEGIN&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; v_aux_SHAPE :&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; :new&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SHAPE&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; v_aux_xcoord :&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sde&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;st_geometry_operators&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;st_x_f &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;v_aux_SHAPE&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; v_aux_ycoord :&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sde&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;st_geometry_operators&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;st_y_f &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;v_aux_SHAPE&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt;&amp;nbsp; SOME_ATRIBUTE &lt;SPAN class="keyword token"&gt;INTO&lt;/SPAN&gt; v_aux_intersect_value &lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; REFERENCE_FEATCLASS &lt;SPAN class="keyword token"&gt;WHERE&lt;/SPAN&gt; sde&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;st_relation_operators&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;st_intersects_f&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;v_aux_SHAPE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;REFERENCE_FEATCLASS&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SHAPE&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; 

 
&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;-- Update fields in Feat Class &lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; :new&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;COORD_X :&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; v_aux_xcoord&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; :new&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;COORD_Y :&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; v_aux_ycoord&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; :new&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ATRIBUTE :&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; v_aux_intersect_value&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp; EXCEPTION
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;WHEN&lt;/SPAN&gt; OTHERS &lt;SPAN class="keyword token"&gt;THEN&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;-- Consider logging the error and then re-raise&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAISE&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;END&lt;/SPAN&gt; TRG_FEATCLASS_TABLE_NAME&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;/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;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;/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;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;/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;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example the geographic coordinates are written to 2 fields and values are obtained from an external featureclass. The trigger is activated after the save. It works well in ArcGIs Pro, in ArcMap 10.5 the st_intersects gives problems&lt;/P&gt;&lt;P&gt;More information about using PLSQL in combination with ST_GEOMETRY in this link: &lt;A href="https://support.esri.com/en/technical-article/000010459" rel="nofollow noopener noreferrer" target="_blank"&gt;https://support.esri.com/en/technical-article/000010459&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Since this trigger in a production environment might slow the edit process, we are thinking about using a simpler trigger which marks all geographically edited features and use the same kind of code in a cursor which runs regularly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:40:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861002#M5705</guid>
      <dc:creator>Bart-JanSchoenmakers</dc:creator>
      <dc:date>2021-12-12T10:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Use Oracle UPDATE TRIGGER instead of attribute assistant</title>
      <link>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861003#M5706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you editing SDE Oracle data in a versioned environment using the Attribute Assistant?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 14:04:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861003#M5706</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2018-04-27T14:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Use Oracle UPDATE TRIGGER instead of attribute assistant</title>
      <link>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861004#M5707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes we are using the attribute assistant. But since not everyone has this extension active and we are changing to ArcGIS Pro&amp;nbsp;we would like to have a database trigger.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We already use a trigger for new points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 14:39:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861004#M5707</guid>
      <dc:creator>Bart-JanSchoenmakers</dc:creator>
      <dc:date>2018-04-27T14:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Use Oracle UPDATE TRIGGER instead of attribute assistant</title>
      <link>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861005#M5708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you looked into using Attribute Rules in Pro (replacement for AA) instead of implementing Oracle triggers?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 17:30:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861005#M5708</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2018-04-27T17:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use Oracle UPDATE TRIGGER instead of attribute assistant</title>
      <link>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861006#M5709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No we didn't yet. When we started working with attribute assistant, ArcGIS Pro didn't have this option yet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our experience in using the attribute assistant is that not all users&amp;nbsp;always use the extension.&amp;nbsp;Having a server side solution gives more guarantees.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2018 15:01:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/use-oracle-update-trigger-instead-of-attribute/m-p/861006#M5709</guid>
      <dc:creator>Bart-JanSchoenmakers</dc:creator>
      <dc:date>2018-04-30T15:01:57Z</dc:date>
    </item>
  </channel>
</rss>

