-- created by Oraschemadoc Wed Mar  4 07:58:16 2020
-- visit http://www.yarpen.cz/oraschemadoc/ for more info

  CREATE OR REPLACE TRIGGER "SPACEUSER"."RHNSERVER_LOG_TRIG" 
            after insert or update or delete on rhnserver
            for each row
            declare
                log_id_v number;
                tg_op char(1);
            begin
                log_id_v := logging.get_log_id();
                if updating then
                    if :old.ID <> :new.ID then raise_application_error(-20298, 'Cannot update column rhnserver.ID.'); end if;
                    tg_op := 'U';
                end if;
                if deleting then
                        tg_op := 'D';
                else
                    if inserting then tg_op := 'I'; end if;
                end if;
            end;
            
ALTER TRIGGER "SPACEUSER"."RHNSERVER_LOG_TRIG" ENABLE
/
