CREATE TABLE CRM_ASSISTENTEOPER (
  OPERRESPONSAVEL       VARCHAR2(12) NOT NULL,
  OPERASSISTENTE        VARCHAR2(12) NOT NULL,
  NRORG             NUMBER 	     DEFAULT         SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
  IDATIVO           VARCHAR2(1)     DEFAULT 'S' NOT NULL
		CONSTRAINT CKC_IDATIVO_CRM_ASSISTOPER CHECK (IDATIVO IN ('S','N')),
  DTINCLUSAO        DATE                  			NULL,
  DTULTATU          DATE                  			NULL,
  NRORGINCLUSAO     NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')		NULL,
  CDOPERINCLUSAO    VARCHAR2(12)    DEFAULT '1' 		NULL,
  NRORGULTATU       NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')		NULL,
  CDOPERULTATU      VARCHAR2(12)    DEFAULT '1',
		CONSTRAINT PK_ASSISTENTEOPER PRIMARY KEY (OPERRESPONSAVEL,OPERASSISTENTE),
		CONSTRAINT FKCRM00091ASSISTRESP_OPER FOREIGN KEY (OPERRESPONSAVEL) REFERENCES OPERADOR(CDOPERADOR),
		CONSTRAINT FKCRM00092ASSISTASSI_OPER FOREIGN KEY (OPERASSISTENTE) REFERENCES OPERADOR(CDOPERADOR)
)
/

CREATE INDEX CRM00091_FK ON CRM_ASSISTENTEOPER(OPERRESPONSAVEL ASC)
/

CREATE INDEX CRM00092_FK ON CRM_ASSISTENTEOPER(OPERASSISTENTE ASC)
/