CREATE OR REPLACE PROCEDURE LOG_WEBSERVICE_INTEGRACAO(P_LOG          IN VARCHAR2,
                                                      P_SEQLOG       IN VARCHAR2,
                                                      P_DSMETODO     IN VARCHAR2,
                                                      P_IDACAO       IN VARCHAR2,
                                                      P_IDEXIBE      IN VARCHAR2,
                                                      P_IDTIPINTEGR  IN VARCHAR2,
                                                      P_XMLLOG       IN CLOB,
                                                      P_OBSLOG       IN VARCHAR2,
                                                      P_DSLOGINT     IN VARCHAR2,
                                                      P_CDFORNECED   IN VARCHAR2,
                                                      P_CDCLIENTE    IN VARCHAR2,
                                                      P_CDPRODUTO    IN VARCHAR2,
                                                      P_CDFILIAL     IN VARCHAR2,
                                                      P_NRLANCTONF   IN VARCHAR2,
                                                      P_NRSEQITPROD  IN VARCHAR2,
                                                      P_NRLANCESTQ   IN VARCHAR2,
                                                      P_NRSEQUITEM   IN VARCHAR2,
                                                      P_NRAUTOFORN   IN VARCHAR2,
                                                      P_CDFILMOVI    IN VARCHAR2,
                                                      P_SEQLOG_IT    IN VARCHAR2,
                                                      P_XMLLOG_IT    CLOB,
                                                      P_OBSLOG_IT    IN VARCHAR2,
                                                      P_DSLOGINT_IT  IN VARCHAR2)

IS
BEGIN
   IF P_LOG = 'C' THEN
      INSERT INTO USR_LOG_WEBSERVICE
         (SEQLOG,     DSMETODO,   IDACAO,     IDEXIBE,   IDTIPINTEGR, XMLLOG,      OBSLOG,
          DSLOGINT,   CDFORNECED, CDCLIENTE,  CDPRODUTO, CDFILIAL,    NRLANCTONF,  NRSEQITPROD,
          NRLANCESTQ, NRSEQUITEM, NRAUTOFORN, CDFILMOVI)
      VALUES
         (P_SEQLOG,     P_DSMETODO,   P_IDACAO,     P_IDEXIBE,   P_IDTIPINTEGR, P_XMLLOG,      P_OBSLOG,
          P_DSLOGINT,   P_CDFORNECED, P_CDCLIENTE,  P_CDPRODUTO, P_CDFILIAL,    P_NRLANCTONF,  P_NRSEQITPROD,
          P_NRLANCESTQ, P_NRSEQUITEM, P_NRAUTOFORN, P_CDFILMOVI);
   ELSE
      INSERT INTO USR_LOG_WEBSERVICE_DRILL
         (SEQLOG,    DSMETODO,   IDACAO,      XMLLOG,     OBSLOG,     DSLOGINT,   CDPRODUTO,
          CDFILIAL, NRLANCTONF, NRSEQITPROD, NRLANCESTQ, NRSEQUITEM, NRAUTOFORN, CDFILMOVI)
      VALUES
         (P_SEQLOG,   P_DSMETODO,   P_IDACAO,      P_XMLLOG,     P_OBSLOG,     P_DSLOGINT,   P_CDPRODUTO,
          P_CDFILIAL, P_NRLANCTONF, P_NRSEQITPROD, P_NRLANCESTQ, P_NRSEQUITEM, P_NRAUTOFORN, P_CDFILMOVI);
   END IF;
END;
/