CREATE TABLE RELACPRODIMPAF
(
 CDPRODORIG 		VARCHAR2(10),
 CDPRODIMPO 		VARCHAR2(10),
 VRFATARRED 		FLOAT,
 CONSTRAINT PK_RELACPROIMPAF PRIMARY KEY (CDPRODORIG),
 NRORG 			 	NUMBER		    DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 		NOT NULL,
 IDATIVO            VARCHAR2(1)   	DEFAULT 'S' 									NOT NULL,
    CONSTRAINT CKC_IDATIVO_RELPROIMPAF CHECK (IDATIVO IN ('S','N')),
 DTINCLUSAO        	DATE                   											NULL,
 DTULTATU          	DATE                 											NULL,
 NRORGINCLUSAO     	NUMBER        	DEFAULT 1 										NULL,
 CDOPERINCLUSAO    	VARCHAR2(12)  	DEFAULT '1' 									NULL,
 NRORGULTATU       	NUMBER        	DEFAULT 1 										NULL,
 CDOPERULTATU 	 	VARCHAR2(12)  	DEFAULT '1'
)
/
ALTER TABLE RELACPRODIMPAF
  ADD CONSTRAINT FKPED00428RELPRAF FOREIGN KEY(CDPRODORIG)
REFERENCES PRODUTO(CDPRODUTO) ON DELETE CASCADE
/
ALTER TABLE RELACPRODIMPAF
  ADD CONSTRAINT FKPED00429RELPRAF FOREIGN KEY(CDPRODIMPO)
REFERENCES PRODUTO(CDPRODUTO) ON DELETE CASCADE