Note that there are some explanatory texts on larger screens.

plurals
  1. POOracle trigger to queue/dequeue doesn't fire
    primarykey
    data
    text
    <p>Oracle 11g. I have a trigger which calls a procedure. That procedure performs queue and dequeue. When I run the procedure in sqldeveloper, it runs fine. If I update the tables which the trigger fires off, the procedure runs fine. If I go into the application in question and run a process which causes the trigger to fire, the procedure doesn't work. Specifically the queue and dequeue don't work because if I remove the queue/dequeue code, and instead do an insert on a table, the procedure runs fine.</p> <p>So I'm thinking that maybe there's a permissions problem causing the trigger unable to execute on dbms_aq. Does anyone know how to resolve this? Is there a user account that runs the triggers which needs to be given privileges?</p> <p>I don't think the problem is with the procedure because it runs fine. I'm also not passing any dynamic data from the trigger so the way I run the procedure under sqldeveloper is exactly the same way the trigger is calling the procedure.</p> <p>Note: sanitized code</p> <pre><code>create or replace TRIGGER mytrig AFTER INSERT ON INVENTORY_TRANSACTION FOR EACH ROW WHEN ((NEW.CLIENT = 'abcwidgets') AND (NEW.CODE = 'Receipt')) BEGIN dschema.mypack.queue_receipt('abcwidgets','999','bbb','1','88'); EXCEPTION WHEN OTHERS THEN NULL; END; PROCEDURE QUEUE_RECEIPT( CLIENTID IN VARCHAR2 , RECEIPTID IN VARCHAR2 , SITEID IN VARCHAR2 , LINEID IN VARCHAR2 , UPDATE_QTY IN VARCHAR2 ) AS ctxHandle dbms_xmlgen.ctxHandle; l_xml xmltype; queueopts DBMS_AQ.ENQUEUE_OPTIONS_T; msgprops DBMS_AQ.MESSAGE_PROPERTIES_T; msgid RAW(16); BEGIN ctxHandle := dbms_xmlgen.newContext('SELECT line_id, user_data_4 FROM inventory '); l_xml := xmltype(dbms_xmlgen.getxml(ctxHandle)); DBMS_AQ.ENQUEUE ('DSCHEMA.ABCWIDGETS_QUEUE', queueopts, msgprops, l_xml, msgid); END QUEUE_RECEIPT; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload