CREATE TABLE COMANDAVENTEMP(
	CDFILIAL		VARCHAR2(4)	NOT NULL,
	CDLOJA         		VARCHAR2(10) 	NOT NULL,
	NRVENDAREST	 	VARCHAR2(10) 	NOT NULL,
	NRCOMANDA       	VARCHAR2(10) 	NOT NULL,
	NRORG 	       		NUMBER 		DEFAULT 	SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
	IDATIVO			VARCHAR2(1)	DEFAULT 'S' 	NOT NULL
		CONSTRAINT CKC_IDATIVO_COMANDAVENTEMP 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'	NULL,    
		CONSTRAINT PK_COMANDAVENTEMP PRIMARY KEY (CDFILIAL,CDLOJA,NRVENDAREST,NRCOMANDA)
)
/