CREATE TABLE HISTORCAFINCC( 
	NRHISTORCAFINCC   INTEGER             NOT NULL,
	CDCENTCUST        VARCHAR2(6)         NOT NULL,
	CDCLASSFINA       VARCHAR2(6)         NOT NULL,
	CDEMPRESA         VARCHAR2(2)         NOT NULL,  
	CDFILIAL          VARCHAR2(4)         NOT NULL,
	DTORCAFINA        DATE                NOT NULL,         
	DSJUSTIFICATIVA   VARCHAR2(250)       NOT NULL,
	DTALTERACAO       DATE                NOT NULL,
	CDOPERADOR        VARCHAR2(12)        NOT NULL,
	VRORCAFINAANT     FLOAT               NULL,    
	VREXTOLEORCAANT   FLOAT               NULL,  
    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_HISTORCAFINCC CHECK (IDATIVO IN ('S','N')),
        CONSTRAINT PK_HISTORCAFINCC PRIMARY KEY (NRHISTORCAFINCC)
)
/

CREATE SEQUENCE SEQ_HISTORCAFINCC START WITH 1 MINVALUE 1 INCREMENT BY 1
/