CREATE TABLE RATEIOCREDMAPA
(	NRSEQUMAPAPU      VARCHAR2(10)    NOT NULL,
	CDTPCREDPICOITE   VARCHAR2(3)     NOT NULL, 
	VRPERCREDITO      FLOAT           NOT 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_RATEIOCREDMAPA CHECK (IDATIVO IN ('S','N')),
		CONSTRAINT PK_RATEIOCREDMAPA PRIMARY KEY (NRSEQUMAPAPU, CDTPCREDPICOITE))
/

ALTER TABLE RATEIOCREDMAPA ADD CONSTRAINT FKFIS00882MAPAAPUR FOREIGN KEY (NRSEQUMAPAPU)
	REFERENCES MAPAAPURAC (NRSEQUMAPAPU) ON DELETE CASCADE
/

CREATE INDEX FIS00882_FK ON RATEIOCREDMAPA (NRSEQUMAPAPU ASC)
/

ALTER TABLE ENVIOEVENTOREINF ADD NRINSJURFILI VARCHAR2(20) NULL
/