...
Code Block |
---|
set serveroutput on size 5000 call dbms_java.set_output(5000); |
B. Defining the trigger in Oracle (sample)
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;
|