CREATE TABLE DADOSENTREGANF (
    CDFILIAL 		  VARCHAR2(4) NOT NULL,
    NRLANCTONF 	  	  VARCHAR2(10) NOT NULL,
    DTENTREGANF 	  DATE,
    NMRECEBEDOR 	  VARCHAR2(100),
    DSLINKANEXO 	  VARCHAR2(300),
    DSINFCOMPNFE 	  VARCHAR2(500),
    IDNFENTREGUE 	  VARCHAR2(1),
	NRORG             NUMBER 	      DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 		NOT NULL,
    IDATIVO           VARCHAR2(1)     DEFAULT 'S'					NOT NULL,
    DTINCLUSAO        DATE            DEFAULT SYSDATE,
    DTULTATU          DATE            DEFAULT SYSDATE,
    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',
		CONSTRAINT CKC_IDATIVO_DADOSENTREGANF CHECK (IDATIVO IN ('S','N')),
		CONSTRAINT PK_DADOSENTREGANF PRIMARY KEY (CDFILIAL, NRLANCTONF),
		CONSTRAINT FKFIS00919NOTAFISCAL FOREIGN KEY (CDFILIAL, NRLANCTONF) REFERENCES NOTAFISCAL(CDFILIAL, NRLANCTONF)
)
/

CREATE INDEX FIS00919_FK ON DADOSENTREGANF (CDFILIAL, NRLANCTONF)
/