<?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 SQL Trigger in non versioned feature class in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/sql-trigger-in-non-versioned-feature-class/m-p/96016#M587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;BR /&gt;We need to make a trigger that obtains the object id that is being updated in a non versioned feature class, this value is a parameter for a store produre.&lt;/P&gt;&lt;P&gt;The feature class is publish as a service because we need to collect data with the collector app for our leaks.&lt;/P&gt;&lt;P&gt;We took a trigger from the geonet community as a example but it shows an error when we update the record.&lt;/P&gt;&lt;P&gt;Thank you for the help!&lt;/P&gt;&lt;P&gt;Gaby&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; AFTER UPDATE&lt;BR /&gt;AS&lt;/P&gt;&lt;P&gt;declare @orderservi varchar (10)&lt;BR /&gt;declare @estatus integer&lt;/P&gt;&lt;P&gt;BEGIN&lt;BR /&gt; &lt;BR /&gt; SET NOCOUNT ON;&lt;/P&gt;&lt;P&gt;UPDATE [SDE].[CEA_FUGASQROVCT] &lt;BR /&gt; SET FallaHoraI = getdate() &lt;BR /&gt; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; UPDATE [SDE].[CEA_FUGASQROVCT] &lt;BR /&gt; SET FallaHoraF = getdate() &lt;BR /&gt; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;&lt;P&gt;SELECT TOP 1 @orderservi =OrdenServi from sde.CEA_FUGASQROVCT WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;BR /&gt; SELECT TOP 1 @estatus = Estatus from sde.CEA_FUGASQROVCT WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED) &lt;BR /&gt; &lt;BR /&gt; If @estatus = 502 &lt;BR /&gt; exec dbo.cea_pr_fuga_gis @orderservi&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;GO&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Oct 2017 21:33:07 GMT</pubDate>
    <dc:creator>Comisión_Estatal_de_Aguasde_Qu</dc:creator>
    <dc:date>2017-10-10T21:33:07Z</dc:date>
    <item>
      <title>SQL Trigger in non versioned feature class</title>
      <link>https://community.esri.com/t5/developers-questions/sql-trigger-in-non-versioned-feature-class/m-p/96016#M587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;BR /&gt;We need to make a trigger that obtains the object id that is being updated in a non versioned feature class, this value is a parameter for a store produre.&lt;/P&gt;&lt;P&gt;The feature class is publish as a service because we need to collect data with the collector app for our leaks.&lt;/P&gt;&lt;P&gt;We took a trigger from the geonet community as a example but it shows an error when we update the record.&lt;/P&gt;&lt;P&gt;Thank you for the help!&lt;/P&gt;&lt;P&gt;Gaby&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; AFTER UPDATE&lt;BR /&gt;AS&lt;/P&gt;&lt;P&gt;declare @orderservi varchar (10)&lt;BR /&gt;declare @estatus integer&lt;/P&gt;&lt;P&gt;BEGIN&lt;BR /&gt; &lt;BR /&gt; SET NOCOUNT ON;&lt;/P&gt;&lt;P&gt;UPDATE [SDE].[CEA_FUGASQROVCT] &lt;BR /&gt; SET FallaHoraI = getdate() &lt;BR /&gt; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; UPDATE [SDE].[CEA_FUGASQROVCT] &lt;BR /&gt; SET FallaHoraF = getdate() &lt;BR /&gt; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;&lt;P&gt;SELECT TOP 1 @orderservi =OrdenServi from sde.CEA_FUGASQROVCT WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;BR /&gt; SELECT TOP 1 @estatus = Estatus from sde.CEA_FUGASQROVCT WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED) &lt;BR /&gt; &lt;BR /&gt; If @estatus = 502 &lt;BR /&gt; exec dbo.cea_pr_fuga_gis @orderservi&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;GO&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2017 21:33:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/sql-trigger-in-non-versioned-feature-class/m-p/96016#M587</guid>
      <dc:creator>Comisión_Estatal_de_Aguasde_Qu</dc:creator>
      <dc:date>2017-10-10T21:33:07Z</dc:date>
    </item>
  </channel>
</rss>

