CREATE TABLE ALIQIMPFISEXT (
   CDIMPEXT 		VARCHAR2(10) 		NOT NULL,
   CDFILIAL       		VARCHAR2(4)      		NOT NULL,
   VRPEALIMPFIS       	FLOAT(126)        		NOT NULL,
   CDIMPOSTO       		VARCHAR2(2)      		NOT NULL,
   NRORG                       	NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
   IDATIVO                    	VARCHAR2(1)     		DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_ALIQIMPFISEXT 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',
	CONSTRAINT PK_ALIQIMPFISEXT PRIMARY KEY (CDIMPEXT, CDFILIAL, VRPEALIMPFIS, CDIMPOSTO)
)
/

CREATE INDEX VND00760_FK ON ALIQIMPFISEXT (CDFILIAL ASC)
/

ALTER TABLE ALIQIMPFISEXT ADD 
	CONSTRAINT FKVND00760FILIAL FOREIGN KEY (CDFILIAL)
		REFERENCES FILIAL (CDFILIAL)
/

CREATE INDEX VND00761_FK ON ALIQIMPFISEXT (CDIMPOSTO ASC)
/

ALTER TABLE ALIQIMPFISEXT ADD 
	CONSTRAINT FKVND00761ALIQIMPFISEXT FOREIGN KEY (CDIMPOSTO)
		REFERENCES IMPOSTO (CDIMPOSTO)