CREATE TABLE FCT_QTPARCMAXIMAOPER (
	NRQTPARCMAXIMAOPER 		NUMBER 									NOT NULL,
	CDOPERADOR 			VARCHAR2(12) 								NOT NULL,
	QTPARCMAXIMAOPER   		NUMBER 		DEFAULT 1						NOT NULL,
	NRORG                  		NUMBER          DEFAULT         SYS_CONTEXT('nrorg_ctx','nrorg') 	NOT NULL,
    	IDATIVO                		VARCHAR2(1)     DEFAULT 'S' 						NOT NULL
    		CONSTRAINT CKC_IDATIVO_FCT_QTPRCMAXMPER     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 FCT_QTPARCMAXIMAOPER ADD CONSTRAINT PK_FCT_QTPARCMAXIMAOPER PRIMARY KEY (NRQTPARCMAXIMAOPER)
/
CREATE INDEX SM00212_FK ON FCT_QTPARCMAXIMAOPER (CDOPERADOR ASC)
/
ALTER TABLE FCT_QTPARCMAXIMAOPER ADD CONSTRAINT FKSM00212OPER_OPERADOR
		FOREIGN KEY (CDOPERADOR) REFERENCES OPERADOR (CDOPERADOR)
/
ALTER TABLE FCT_QTPARCMAXIMAOPER ADD CONSTRAINT CKC_IDATIVO_QTPARCMAXIMAOPER CHECK(IDATIVO IN ('S', 'N'))
/
ALTER TABLE FCT_ITEMORCAMENTO ADD NMCONTRATUALITEMORCA VARCHAR2(250)