CREATE TABLE FCT_LOGASSINATDIGITAL (
    NRLOGASSINATDIGITAL NUMBER NOT NULL,
    NRSEQORCAMENTO      NUMBER,
    NRSEQCONTRATO       NUMBER,
    IDDOCUMCERTSIGN     VARCHAR2(500),
    NRCPFSIGNATARIO     VARCHAR2(11),
    NRSEQORCADOC        NUMBER,
    NRSEQCONTDOC        NUMBER,
    DSERRO              CLOB NOT NULL,
    NRORG             	NUMBER 	     DEFAULT         SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
    IDATIVO           	VARCHAR2(1)     DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_FCT_LOGASSINATDIG CHECK (IDATIVO IN ('S','N')),
    DTINCLUSAO        	DATE                  			NULL,
    DTULTATU          	DATE                  			NULL,
    NRORGINCLUSAO     	NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')		NULL,
    CDOPERINCLUSAO    	VARCHAR2(12)    DEFAULT '1' 		NULL,
    NRORGULTATU       	NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')		NULL,
    CDOPERULTATU      	VARCHAR2(12)    DEFAULT '1'
)
/

ALTER TABLE FCT_LOGASSINATDIGITAL ADD CONSTRAINT PK_FCT_LOGASSINATDIGITAL PRIMARY KEY (NRLOGASSINATDIGITAL)
/

CREATE INDEX SM00342_FK ON FCT_LOGASSINATDIGITAL(NRSEQORCAMENTO ASC)
/

ALTER TABLE FCT_LOGASSINATDIGITAL ADD CONSTRAINT FKSM00342LOGASSDIGI_ORCAMEN
    FOREIGN KEY (NRSEQORCAMENTO) REFERENCES FCT_ORCAMENTO (NRSEQORCAMENTO)
/

CREATE INDEX SM00343_FK ON FCT_LOGASSINATDIGITAL(NRSEQCONTRATO ASC)
/

ALTER TABLE FCT_LOGASSINATDIGITAL ADD CONSTRAINT FKSM00343LOGASSDIGI_CONTRATO
    FOREIGN KEY (NRSEQCONTRATO) REFERENCES FCT_CONTRATO (NRSEQCONTRATO)
/

CREATE INDEX SM00344_FK ON FCT_LOGASSINATDIGITAL(NRSEQORCADOC ASC)
/

ALTER TABLE FCT_LOGASSINATDIGITAL ADD CONSTRAINT FKSM00344LOGASSDIGI_ORCADOC
    FOREIGN KEY (NRSEQORCADOC) REFERENCES FCT_ORCAMENTODOC (NRSEQORCADOC)
/

CREATE INDEX SM00345_FK ON FCT_LOGASSINATDIGITAL(NRSEQCONTDOC ASC)
/

ALTER TABLE FCT_LOGASSINATDIGITAL ADD CONSTRAINT FKSM00345LOGASSDIGI_CONTDOC
    FOREIGN KEY (NRSEQCONTDOC) REFERENCES FCT_CONTRATODOC (NRSEQCONTDOC)
/