CREATE OR REPLACE
TRIGGER USR_ATU_ED_ITEMSOLI_EXT BEFORE INSERT ON ITEMSOLI
FOR EACH ROW
DECLARE
  V_DSREMOTEADDR VARCHAR2(15);
  V_DSREMOTEHOST VARCHAR2(15);
  V_DSSERVERRDM  VARCHAR2(20);
  V_DSSERVMETHOD VARCHAR2(30);
  V_DSREMOTEOPER VARCHAR2(12);
  V_IDSOLEXTRA   VARCHAR2(1);
BEGIN
   WEBTUNNING(V_DSREMOTEADDR,
              V_DSREMOTEHOST,
              V_DSSERVERRDM,
              V_DSSERVMETHOD,
              V_DSREMOTEOPER);
   IF ((:NEW.CDFILIOPELOG IS NOT NULL) AND (V_DSSERVERRDM LIKE 'rdmLancaSoliCmp%')) THEN
      SELECT NVL(MAX(IDSOLEXTRA), 'N')
        INTO V_IDSOLEXTRA
        FROM SOLICITA
       WHERE CDFILLANCA = :NEW.CDFILLAN
         AND CDFILSOLI  = :NEW.CDFILSOLI
         AND NRSOLICMP  = :NEW.NRSOLICMP;
      IF V_IDSOLEXTRA = 'S' THEN
         :NEW.CDFILIOPELOG := '';
      END IF;
   END IF;
END;
/

-- VERSAO --
BEGIN ATUVEROBJ('USR_ATU_ED_ITEMSOLI_EXT','6.00XXX'); END;
/
