CREATE TABLE PARAMIMPPEDIDO
( 
 CDPARAMIMPPED 		VARCHAR2(4) 	DEFAULT '0001',
 CLIIMPORTACAO 		VARCHAR2(1) 	DEFAULT 'C' 
    CONSTRAINT CKC_CLIIMPORTACAO CHECK (CLIIMPORTACAO IN ('C','D')),
 CDVENDEDOR 		VARCHAR2(5),
 IDUTRELACPRODAF 	VARCHAR2(1) 	DEFAULT 'N'
    CONSTRAINT CKC_IDUTRELACPRODAFO CHECK (IDUTRELACPRODAF IN ('N','S')),
 NRORG 			 	NUMBER		    DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 		NOT NULL,
 IDATIVO            VARCHAR2(1)   	DEFAULT 'S' 									NOT NULL,
    CONSTRAINT CKC_IDATIVO_PARAIMPPED 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 PARAMIMPPEDIDO
ADD CONSTRAINT PK_PARAMIMPPEDIDO PRIMARY KEY (CDPARAMIMPPED)
/
ALTER TABLE PARAMIMPPEDIDO
  ADD CONSTRAINT FKPED00427PARIMP FOREIGN KEY(CDVENDEDOR)
REFERENCES VENDEDOR(CDVENDEDOR)
/
INSERT INTO PARAMIMPPEDIDO(CDPARAMIMPPED)
VALUES('0001')
/
COMMIT