Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

B. Defining the trigger in Oracle (sampleexample)

Code Block
 create or replace TRIGGER "myTrigger" AFTER
 INSERT OR UPDATE ON "Any_Table" FOR EACH ROW
 DECLARE
   jobid               binary_integer;
 BEGIN
 
  IF :new."DOWNLOAD" = 2 THEN
    SCHEDULER_START_JOB('localhost', 4363, 'myJobname', '<params><param name="queue" value="' ||  :new."NORMALIZED_NAME" || '"/><param name="directory" value="download_einzeldrucker"/></params>');
  END IF;
 
 EXCEPTION
   WHEN NO_DATA_FOUND THEN
     BEGIN
       /* Default: raise an error */
       RAISE_APPLICATION_ERROR( -20001,'TRIGGER:LF_QUEUES_SIGNAL: job could not be started: myJobname' );
     END;
   WHEN OTHERS THEN
     BEGIN
       /* Default: raise an error */
       RAISE_APPLICATION_ERROR( -20002, 'TRIGGER:LF_QUEUES_SIGNAL: an error occurred: ' || SQLCODE );
     END;
 
 END;