<?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>Question Re: Automatic Commit statements within Triggers in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819188#M4850031</link>
    <description>&lt;P&gt;Here is how to insert an image into a comment: &lt;B&gt;Use naked HTML like this...&lt;/B&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;img src="https://qph.fs.quoracdn.net/main-qimg-94e93244063f7294636ee10532cc5896.webp" width="200"&amp;gt;
&lt;/PRE&gt;

&lt;P&gt;&lt;IMG width="200" src="https://qph.fs.quoracdn.net/main-qimg-94e93244063f7294636ee10532cc5896.webp" /&gt;&lt;/P&gt;
&lt;P&gt;You're limited to using links to images; you cannot upload images to this forum any more.&lt;/P&gt;
&lt;P&gt;Also, the width="xxx" attribute is very handy to make giant images fit into comments.&lt;/P&gt;
&lt;P&gt;Another tip: If you are trying to show HTML in a PRE tab (like above), change all embedded "&amp;lt;" characters to "&amp;amp;lt;"&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2020 08:00:44 GMT</pubDate>
    <dc:creator>Breck_Carter</dc:creator>
    <dc:date>2020-02-18T08:00:44Z</dc:date>
    <item>
      <title>Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaq-p/13819176</link>
      <description>&lt;P&gt;Hi,
I need to execute an automatic commited statement (alter event statement) within a trigger of a table.&lt;/P&gt;
&lt;P&gt;I get an error message stating: COMMIT/ROLLBACK not allowed within atomic operation! Error Code = -267, SQL State = 42000.&lt;/P&gt;
&lt;P&gt;Is there any workaround to get this working?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 07:47:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaq-p/13819176</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-02-17T07:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819177#M4850020</link>
      <description>&lt;P&gt;A trigger runs as atomic part of the triggering DML statement (i.e. the according INSERT/UPDATE/DELETE/MERGE statement) and as such cannot do a commit on its own, it must be part of the trancsaction the according statement belongs to. (Aside: Within a trigger you can use the ROLLBACK TRIGGER statement, and that will also rollback the according statement.)&lt;/P&gt;
&lt;P&gt;However, you could start an event from within your trigger, and events run in their own connections and therefore in their own transactions. There are several discussions in this forum dealting with such setups.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 08:29:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819177#M4850020</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-02-17T08:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819178#M4850021</link>
      <description>&lt;P&gt;OK, but back to my question, is there a workaround to execute an &lt;STRONG&gt;ALTER EVENT&lt;/STRONG&gt; statement from within a trigger?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 08:38:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819178#M4850021</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-02-17T08:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819179#M4850022</link>
      <description>&lt;P&gt;Should I then understand from your answer, that within the trigger I should start another event &lt;STRONG&gt;TRIGGER EVENT MYHELPEVENT&lt;/STRONG&gt;, and then alter my target event from within this MYHELPEVENT? &lt;STRONG&gt;ALTER MYTARGETEVENT&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 08:51:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819179#M4850022</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-02-17T08:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819180#M4850023</link>
      <description>&lt;P&gt;Yes, as an ALTER EVENT like most (or all?) DDL statement issues an automatic commit, you cannot run that from your trigger code - but you could trigger another event that itself calls ALTER EVENT.&lt;/P&gt;
&lt;P&gt;You could even use the EVENT_PARAMETER function to supply the according information from the trigger to the event.&lt;/P&gt;
&lt;P&gt;See a sample &lt;A href="https://sqlanywhere-forum.sap.com/questions/12#32"&gt;there&lt;/A&gt; for the latter.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 09:08:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819180#M4850023</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-02-17T09:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819181#M4850024</link>
      <description>&lt;P&gt;OK, thank you for the information.
It will be a complicated solution, but at least it works!!&lt;/P&gt;
&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 09:13:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819181#M4850024</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-02-17T09:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819182#M4850025</link>
      <description>&lt;P&gt;EVENT_PARAMETER would not be helpful, since my point is not to change the event itself, but the scheduler.&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ALTER EVENT MYTARGETEVENT SCHEDULE START TIME '20:00'&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 11:24:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819182#M4850025</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-02-17T11:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819183#M4850026</link>
      <description>&lt;P&gt;Well, you could use the parameter to specify the start time (or whatever has to be changed), unless that information is available other wise. You could also use several parameters to specify both the event name and the start time or whatever, so your "helper event" could alter different events...&lt;/P&gt;
&lt;P&gt;It's just a way to "transport information" between the invoker of the event (here your trigger) and the event itself. Of course you could also use database-scope variables (in v17) or (possibly temporary share by all) tables to do so.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 11:38:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819183#M4850026</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-02-17T11:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819184#M4850027</link>
      <description>&lt;P&gt;I still have problem with the first approach (trigger event from within a trigger.&lt;/P&gt;
&lt;P&gt;I get the following error;
Permission denied: you do not have permission to use the "TRIGGER EVENT" statement
Error Code=-121, SQL state=42000&lt;/P&gt;
&lt;P&gt;Despite I am connected as DBA!&lt;/P&gt;
&lt;P&gt;Any ideas please?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 12:06:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819184#M4850027</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-02-17T12:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819185#M4850028</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;Triggers execute using the privileges of the owner of the table on which they are defined, not the privileges of the user who caused the trigger to fire, and not the privileges of the user who created the trigger.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the table owner is not the one who created the event, I guess you need to &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;either give the table owner the MANAGE ANY EVENT system privilege or&lt;/LI&gt;
&lt;LI&gt;wrap the TRIGGER EVENT statement within a procedure (owned by the event creator) and allow the table owner the execution of that wrapper procedure, and call that procedure from your trigger.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 17 Feb 2020 12:29:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819185#M4850028</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-02-17T12:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819186#M4850029</link>
      <description>&lt;P&gt;Only if I knew how to insert photos in this page!!
&lt;A href="https://www.quora.com/What-does-the-term-hats-off-mean"&gt;https://www.quora.com/What-does-the-term-hats-off-mean&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Respect and Thanks!!!!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 13:25:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819186#M4850029</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-02-17T13:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819187#M4850030</link>
      <description>&lt;P&gt;Wow, that's really nice, thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 13:39:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819187#M4850030</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-02-17T13:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819188#M4850031</link>
      <description>&lt;P&gt;Here is how to insert an image into a comment: &lt;B&gt;Use naked HTML like this...&lt;/B&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;img src="https://qph.fs.quoracdn.net/main-qimg-94e93244063f7294636ee10532cc5896.webp" width="200"&amp;gt;
&lt;/PRE&gt;

&lt;P&gt;&lt;IMG width="200" src="https://qph.fs.quoracdn.net/main-qimg-94e93244063f7294636ee10532cc5896.webp" /&gt;&lt;/P&gt;
&lt;P&gt;You're limited to using links to images; you cannot upload images to this forum any more.&lt;/P&gt;
&lt;P&gt;Also, the width="xxx" attribute is very handy to make giant images fit into comments.&lt;/P&gt;
&lt;P&gt;Another tip: If you are trying to show HTML in a PRE tab (like above), change all embedded "&amp;lt;" characters to "&amp;amp;lt;"&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 08:00:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819188#M4850031</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2020-02-18T08:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Commit statements within Triggers</title>
      <link>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819189#M4850032</link>
      <description>&lt;P&gt;Thank you &lt;A href="http://sqlanywhere-forum.sap.com/users/2/breck-carter"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/2/breck-carter"&gt;@Breck&lt;/A&gt;!!&lt;/P&gt;
&lt;P&gt;Here I can learn HTML too!!&lt;/P&gt;
&lt;P&gt;&lt;IMG width="200" src="https://s3-media0.fl.yelpcdn.com/bphoto/e1_rdVX6s9Oqsg2KqI7k3Q/o.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 09:51:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automatic-commit-statements-within-triggers/qaa-p/13819189#M4850032</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-02-18T09:51:29Z</dc:date>
    </item>
  </channel>
</rss>

