CREATE OR REPLACE TRIGGER USSI_JOBS$AUDTRG 
 AFTER INSERT OR DELETE OR UPDATE ON
USSI_JOBS FOR EACH ROW                                                          
DECLARE 
v_operation VARCHAR2(10) := NULL;                                      
BEGIN                                                                           
IF INSERTING THEN 
       v_operation := 'INS'; 
    ELSIF UPDATING THEN 
      
v_operation := 'UPD'; 
    ELSE 
       v_operation := 'DEL'; 
    END IF; 
    
IF INSERTING OR UPDATING THEN
                                                  
INSERT INTO USSI_JOBS$AUD (                                                     
UJB_JOBID,                                                                      
UJB_RANDOMID,                                                                   
UJB_EMAIL_ADDRESS,                                                              
UJB_CERTIFICATE,                                                                
UJB_SIGNATUREBLOCK,
UJB_SIGNER_COMMENT,                                                             
UJB_INPUTFILE,                                                                  
UJB_OUTPUTFILE,                                                                 
UJB_JOBSTATUS,                                                                  
UJB_JOBSTATUSDETAIL,                                                            
UJB_APPLOGO,                                                                    
UJB_REQUESTOR,
UJB_REQUESTOR_COMMENT,                                                                    
UJB_ECOPY,                                                                      
UJB_ECOPYOUTPUTFILE,                                                            
UJB_TARGET_LOCATION,                                                            
UJB_NEWWINDOW_YN,                                                               
UJB_CREATEDATE,                                                                 
UJB_MODIFYDATE,                                                                 
UJB_JOBURL,
UJB_FUNCTION,                                                                     
aud_action,aud_timestamp) VALUES (                                              
:new.UJB_JOBID,                                                                 
:new.UJB_RANDOMID,                                                              
:new.UJB_EMAIL_ADDRESS,
:new.UJB_CERTIFICATE,
:new.UJB_SIGNATUREBLOCK,                                                        
:new.UJB_SIGNER_COMMENT,                                                                                                                    
:new.UJB_INPUTFILE,                                                             
:new.UJB_OUTPUTFILE,                                                            
:new.UJB_JOBSTATUS,                                                             
:new.UJB_JOBSTATUSDETAIL,                                                       
:new.UJB_APPLOGO,
:new.UJB_REQUESTOR,
:new.UJB_REQUESTOR_COMMENT,                                                               
:new.UJB_ECOPY,                                                                 
:new.UJB_ECOPYOUTPUTFILE,                                                       
:new.UJB_TARGET_LOCATION,                                                       
:new.UJB_NEWWINDOW_YN,                                                          
:new.UJB_CREATEDATE,                                                            
:new.UJB_MODIFYDATE,                                                            
:new.UJB_JOBURL,
:new.UJB_FUNCTION,                                                                
v_operation,SYSDATE);
                                                          
                                       
ELSE 
                                                                          
INSERT INTO USSI_JOBS$AUD (                                                     
UJB_JOBID,                                                                      
UJB_RANDOMID,                                                                   
UJB_EMAIL_ADDRESS,                                                              
UJB_CERTIFICATE,                                                                
UJB_SIGNATUREBLOCK,                                                             
UJB_INPUTFILE,                                                                  
UJB_OUTPUTFILE,                                                                 
UJB_JOBSTATUS,                                                                  
UJB_JOBSTATUSDETAIL,                                                            
UJB_APPLOGO,                                                                    
UJB_REQUESTOR,                                                                    
UJB_ECOPY,                                                                      
UJB_ECOPYOUTPUTFILE,                                                            
UJB_TARGET_LOCATION,                                                            
UJB_NEWWINDOW_YN,                                                               
UJB_CREATEDATE,                                                                 
UJB_MODIFYDATE,                                                                 
UJB_JOBURL,
UJB_FUNCTION,                                                                     
aud_action,aud_timestamp) VALUES (                                              
:old.UJB_JOBID,                                                                 
:old.UJB_RANDOMID,                                                              
:old.UJB_EMAIL_ADDRESS,                                                         
:old.UJB_CERTIFICATE,                                                           
:old.UJB_SIGNATUREBLOCK,                                                        
:old.UJB_INPUTFILE,                                                             
:old.UJB_OUTPUTFILE,                                                            
:old.UJB_JOBSTATUS,                                                             
:old.UJB_JOBSTATUSDETAIL,                                                       
:old.UJB_APPLOGO,                                                               
:old.UJB_REQUESTOR,                                                               
:old.UJB_ECOPY,                                                                 
:old.UJB_ECOPYOUTPUTFILE,                                                       
:old.UJB_TARGET_LOCATION,                                                       
:old.UJB_NEWWINDOW_YN,                                                          
:old.UJB_CREATEDATE,                                                            
:old.UJB_MODIFYDATE,                                                            
:old.UJB_JOBURL,
:old.UJB_FUNCTION,                                                                
v_operation,SYSDATE);
                                                          
END IF;
END;
/
                                                                 
CREATE OR REPLACE TRIGGER USSI_JOBS_SIGN_REASONS$AUDTRG 
 AFTER INSERT OR DELETE
OR UPDATE ON USSI_JOBS_SIGN_REASONS FOR EACH ROW                                
DECLARE 
v_operation VARCHAR2(10) := NULL;                                      
BEGIN                                                                           
IF INSERTING THEN 
       v_operation := 'INS'; 
    ELSIF UPDATING THEN 
      
v_operation := 'UPD'; 
    ELSE 
       v_operation := 'DEL'; 
    END IF; 
    
IF INSERTING OR UPDATING THEN
                                                  
INSERT INTO USSI_JOBS_SIGN_REASONS$AUD (                                        
UJR_JOBID,                                                                      
UJR_REASON,                                                                     
aud_action,aud_timestamp) VALUES (                                              
:new.UJR_JOBID,                                                                 
:new.UJR_REASON,                                                                
v_operation,SYSDATE);
                                                          
ELSE 
                                                                          
INSERT INTO USSI_JOBS_SIGN_REASONS$AUD (                                        
UJR_JOBID,                                                                      
UJR_REASON,                                                                     
aud_action,aud_timestamp) VALUES (                                              
:old.UJR_JOBID,                                                                 
:old.UJR_REASON,                                                                
v_operation,SYSDATE);
                                                          
END IF;
END;
/
                                                                 
