CREATE TABLE FCT_QTPARCMAXPERFACESS (
	NRQTPARCMAXPERFACESS   		NUMBER 									NOT NULL,
	NRPERFILACESSO 			NUMBER 									NOT NULL,
	QTPARCMAXPERFACESS     		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_QTPRCMXPERACES     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_QTPARCMAXPERFACESS ADD CONSTRAINT PK_FCT_QTPARCMAXPERFACESS PRIMARY KEY (NRQTPARCMAXPERFACESS)
/
CREATE INDEX SM00213_FK ON FCT_QTPARCMAXPERFACESS (NRPERFILACESSO ASC)
/
ALTER TABLE FCT_QTPARCMAXPERFACESS ADD CONSTRAINT FKSM00213OPER_PERFILACESSO 
		FOREIGN KEY (NRPERFILACESSO) REFERENCES PERFILACESSO (NRPERFILACESSO)
/
ALTER TABLE FCT_QTPARCMAXPERFACESS ADD CONSTRAINT CKC_IDATIVO_QTPARCMAXPERFACESS CHECK(IDATIVO IN ('S', 'N'))