CREATE TABLE EMPRTPCTREC
(
   CDTPCTRECEB   		VARCHAR2(6)      	NOT NULL,
   CDEMPRESA     		VARCHAR2(3)      	NOT NULL,
	NRORG           NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
	IDATIVO         VARCHAR2(1) 	DEFAULT 'S' NOT NULL
		CONSTRAINT CKC_IDATIVO_EMPRTPCTREC 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_EMPRTPCTREC PRIMARY KEY (CDEMPRESA, CDTPCTRECEB)
)
/
CREATE INDEX FK_FIN00400 ON EMPRTPCTREC (CDTPCTRECEB ASC)
/
ALTER TABLE EMPRTPCTREC
    ADD CONSTRAINT FKFIN00400TIPOCTRECEBER FOREIGN KEY  (CDTPCTRECEB)
       REFERENCES TIPOCTRECEBER (CDTPCTRECEB) ON DELETE CASCADE