CREATE TABLE CLASSIFICATION_PERFILACESSO(
  ID 			NUMBER(10) 			NOT NULL,
  CLASSIFICATION 	NUMBER(10) 			NOT NULL, 
  NRPERFILACESSO 	NUMBER(10) 			NOT NULL, 
  ORGANIZATION 		NUMBER(10) 			NOT NULL, 
  CREATED_BY 		NUMBER(10) 			DEFAULT NULL NULL, 
  CREATED_AT 		DATE 				DEFAULT SYSDATE NOT NULL, 
  UPDATED_BY 		NUMBER(10) 			DEFAULT NULL NULL, 
  UPDATED_AT 		DATE 				DEFAULT SYSDATE NOT NULL,
  NRORG                 NUMBER 				DEFAULT 	 SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
  IDATIVO               VARCHAR2(1)     		DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_CLAS_PERFACESSO		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',
  CONSTRAINT CLASSIFICATION_PERFILACESSO_PK PRIMARY KEY (ID)
)
/
CREATE SEQUENCE CLASSIF_PERFILACESSO_ID_SEQ START WITH 1 MINVALUE 1 INCREMENT BY 1
/
ALTER TABLE CLASSIFICATION_PERFILACESSO ADD CONSTRAINT CLASSIF_PERFACES_CLASSIF_FK FOREIGN KEY (CLASSIFICATION) REFERENCES CLASSIFICATION (ID)
