CREATE OR REPLACE TRIGGER USR_SOLIEXTRA_SEM_CDFILIOPELOG
BEFORE INSERT
ON ITEMSOLI FOR EACH ROW
DECLARE
   V_IDSOLEXTRA VARCHAR2(1);
   V_IDTIPLAN VARCHAR2(1);
   V_DSREMOTEADDR VARCHAR2(15);
   V_DSREMOTEHOST VARCHAR2(15);
   V_DSSERVERRDM  VARCHAR2(20);
   V_DSSERVMETHOD VARCHAR2(30);
   V_DSREMOTEOPER VARCHAR2(12);
BEGIN
   WEBTUNNING(V_DSREMOTEADDR,
              V_DSREMOTEHOST,
              V_DSSERVERRDM,
              V_DSSERVMETHOD,
              V_DSREMOTEOPER);
   IF SUBSTR(V_DSSERVMETHOD, 1, 14) = 'Confirmar' THEN
      SELECT NVL(MAX(IDSOLEXTRA), 'N'), NVL(MAX(IDTIPLAN), 'M')
        INTO V_IDSOLEXTRA, V_IDTIPLAN
        FROM SOLICITA
       WHERE CDFILSOLI  = :NEW.CDFILSOLI
         AND CDFILLANCA = :NEW.CDFILLAN
         AND NRSOLICMP  = :NEW.NRSOLICMP;
      IF (V_IDSOLEXTRA = 'S' AND V_IDTIPLAN = 'M') THEN
         :NEW.CDFILIOPELOG := NULL;
      END IF;
   END IF;
END;
/
-- VERSAO --
BEGIN ATUVEROBJ('USR_SOLIEXTRA_SEM_CDFILIOPELOG','5.01.003'); END;
/