ALTER TABLE FCT_RELACMEDIDAPROPOSTA ADD IDELEMENTORAIZ VARCHAR2(100)
/ 
CREATE TABLE FCT_RELACHABILIPESSOA ( 
   NRRELACHABILIPESSOA 	NUMBER		NOT NULL,
   CDHABILITSERV 		NUMBER 		NOT NULL, 
   NRPARCNEGOCIO 		NUMBER 		NOT NULL,
   NRORG              		NUMBER 		DEFAULT 1 NOT NULL,
   IDATIVO             		VARCHAR2(1) 	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_RELACHABILIPESSOA 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_RELACHABILIPESSOA ADD CONSTRAINT PK_FCT_RELACHABILIPESSOA PRIMARY KEY (NRRELACHABILIPESSOA)
/
ALTER TABLE FCT_RELACHABILIPESSOA 
  ADD CONSTRAINT FKSM00030HABILSERV FOREIGN KEY (CDHABILITSERV)
      REFERENCES FCT_HABILITSERV (CDHABILITSERV)
/
ALTER TABLE FCT_RELACHABILIPESSOA 
  ADD CONSTRAINT FKSM00031PARCNEG FOREIGN KEY (NRPARCNEGOCIO)
      REFERENCES PARCNEGOCIO (NRPARCNEGOCIO)
/
CREATE TABLE FCT_RELACSERVHABILI (  
   NRRELACSERVHABILI 	NUMBER 		NOT NULL, 
   CDSERVORCA 		NUMBER 		NOT NULL, 
   CDHABILITSERV 		NUMBER 		NOT NULL, 
   NRORG             		NUMBER 		DEFAULT 1 NOT NULL,
   IDATIVO           		VARCHAR2(1)	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_RELACSERVHABILI 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_RELACSERVHABILI ADD CONSTRAINT PK_FCT_RELACSERVHABILI PRIMARY KEY (NRRELACSERVHABILI)
/
ALTER TABLE FCT_RELACSERVHABILI 
  ADD CONSTRAINT FKSM00032HABILSERV FOREIGN KEY (CDHABILITSERV)
      REFERENCES FCT_HABILITSERV (CDHABILITSERV) ENABLE
/
ALTER TABLE FCT_RELACSERVHABILI 
  ADD CONSTRAINT FKSM00033SERVORCA FOREIGN KEY (CDSERVORCA)
      REFERENCES FCT_SERVICOORCA (CDSERVORCA) ENABLE
/
CREATE TABLE FCT_AGENDRECURSOCONT    (
   NRAGENDRECURSOCONT 	NUMBER 		NOT NULL,
   NRSEQCONTRATO 		NUMBER 		NOT NULL,
   NRESTRUTURAM 		NUMBER, 
   QTTOLERANCIARAIO 	NUMBER,
   DTINIAGENDAMENTO   	DATE,
   DTFIMAGENDAMENTO   	DATE, 
   NRORG              		NUMBER 		DEFAULT 1 NOT NULL,
   IDATIVO            		VARCHAR2(1) 	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_AGENDRECURSOCONT 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_AGENDRECURSOCONT ADD CONSTRAINT PK_FCT_AGENDRECURSOCONT PRIMARY KEY (NRAGENDRECURSOCONT)
/
ALTER TABLE FCT_AGENDRECURSOCONT 
  ADD CONSTRAINT FKSM00034ESTRUTURAM FOREIGN KEY (NRESTRUTURAM, NRORG)
      REFERENCES ESTRUTURAM (NRESTRUTURAM, NRORG)
/
ALTER TABLE FCT_AGENDRECURSOCONT 
  ADD CONSTRAINT FKSM00035CONTRATO FOREIGN KEY (NRSEQCONTRATO)
      REFERENCES FCT_CONTRATO(NRSEQCONTRATO)
/
CREATE TABLE FCT_RECURSOSAGENDCONT (
   NRRECURSOSAGENDCONT 	NUMBER		NOT NULL,
   NRAGENDRECURSOCONT  	NUMBER 		NOT NULL,
   NRITEMOCONTRATO     	NUMBER, 
   DTINIAGENDRECURSO   	DATE,
   DTFIMAGENDRECURSO   	DATE, 
   IDTPRECURSO         		CHAR(1),
   CDPRODUTO          		VARCHAR2(10), 
   NRPARCNEPESSOA      	NUMBER, 
   CDEMPRESA           		VARCHAR2(2), 
   CDBEMATIVO          		VARCHAR2(10), 
   CDFILIALPED         		VARCHAR2(4), 
   NRPEDIDO           		VARCHAR2(10), 
   NRITEMPED           		VARCHAR2(10),
   NRRECURSOSUPERIOR   	NUMBER,
   IDMOTIVOAGENDAMENTO 	CHAR(1),
   IDSITUARECGEND      	CHAR(1), 
   DSATIVIDADESAGEND   	VARCHAR2(4000), 
   HRPRIMEIRAENTRADA   	VARCHAR2(6), 
   HRPRIMEIRASAIDA     	VARCHAR2(6), 
   HRSEGUNDAENTRADA   	VARCHAR2(6), 
   HRSEGUNDASAIDA      	VARCHAR2(6), 
   NRTEMPOTOLERANCIA   	NUMBER, 
   IDREPETDOMINGO     	VARCHAR2(3), 
   IDREPETSEGUNDA      	VARCHAR2(3), 
   IDREPETTERCA        		VARCHAR2(3), 
   IDREPETQUARTA       	VARCHAR2(3), 
   IDREPETQUINTA       	VARCHAR2(3), 
   IDREPETSEXTA        		VARCHAR2(3), 
   IDREPETSABADO      	VARCHAR2(3), 
   NRORG              		NUMBER 		DEFAULT 1 NOT NULL,
   IDATIVO            		VARCHAR2(1) 	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_RECURSAGENDCONT  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_RECURSOSAGENDCONT ADD CONSTRAINT PK_FCT_RECURSOSAGENDCONT PRIMARY KEY (NRRECURSOSAGENDCONT)
/
ALTER TABLE FCT_RECURSOSAGENDCONT 
  ADD CONSTRAINT FKSM00036ITEMCONT FOREIGN KEY (NRITEMOCONTRATO)
      REFERENCES FCT_ITEMCONTRATO(NRITEMOCONTRATO)
/  
ALTER TABLE FCT_RECURSOSAGENDCONT 
  ADD CONSTRAINT  FKSM00037PRODUTO FOREIGN KEY (CDPRODUTO)
      REFERENCES PRODUTO(CDPRODUTO)
/  
ALTER TABLE FCT_RECURSOSAGENDCONT 
  ADD CONSTRAINT FKSM00038PARCNEG FOREIGN KEY (NRPARCNEPESSOA)
      REFERENCES PARCNEGOCIO(NRPARCNEGOCIO)
/  
ALTER TABLE FCT_RECURSOSAGENDCONT 
  ADD CONSTRAINT FKSM00039BEMATIVO FOREIGN KEY (CDEMPRESA, CDBEMATIVO)
      REFERENCES BEMATIVO(CDEMPRESA, CDBEMATIVO) 
/      
ALTER TABLE FCT_RECURSOSAGENDCONT 
  ADD CONSTRAINT FKSM00040ITEMPEDIDO FOREIGN KEY (CDFILIALPED, NRPEDIDO, NRITEMPED)
      REFERENCES ITEMPEDIDO(CDFILIAL, NRPEDIDO, NRITEMPED) 
/                
ALTER TABLE FCT_RECURSOSAGENDCONT ADD CONSTRAINT CKC_IDMOTIVOAGENDAMENTO CHECK (IDMOTIVOAGENDAMENTO IN ('1', '2', '3', '4', '5'))
/
ALTER TABLE FCT_RECURSOSAGENDCONT ADD CONSTRAINT CKC_IDSITUARECGEND CHECK (IDSITUARECGEND IN ('1', '2'))
/
ALTER TABLE FCT_RECURSOSAGENDCONT ADD CONSTRAINT CKC_IDTPRECURSO CHECK (IDTPRECURSO IN ('1','2', '3'))
/
ALTER TABLE FCT_RECURSOSAGENDCONT ADD CONSTRAINT CKC_IDREPETDOMINGO_AGEN CHECK (IDREPETDOMINGO IN ('S','N'))
/
ALTER TABLE FCT_RECURSOSAGENDCONT ADD CONSTRAINT CKC_IDREPETSEGUNDA_AGEN CHECK (IDREPETSEGUNDA IN ('S','N'))
/
ALTER TABLE FCT_RECURSOSAGENDCONT ADD CONSTRAINT CKC_IDREPETTERCA_AGEN CHECK (IDREPETTERCA IN ('S','N'))
/
ALTER TABLE FCT_RECURSOSAGENDCONT ADD CONSTRAINT CKC_IDREPETQUARTA_AGEN CHECK (IDREPETQUARTA IN ('S','N'))
/
ALTER TABLE FCT_RECURSOSAGENDCONT ADD CONSTRAINT CKC_IDREPETQUINTA_AGEN CHECK (IDREPETQUINTA IN ('S','N'))
/
ALTER TABLE FCT_RECURSOSAGENDCONT ADD CONSTRAINT CKC_IDREPETSEXTA_AGEN CHECK (IDREPETSEXTA IN ('S','N'))
/
ALTER TABLE FCT_RECURSOSAGENDCONT ADD CONSTRAINT CKC_IDREPETSABADO_AGEN CHECK (IDREPETSABADO IN ('S','N'))
/
  CREATE TABLE FCT_DEVAGENDRECURCON (
    NRDEVAGENDRECURCON 	NUMBER		NOT NULL, 
    NRRECURSOSAGENDCONT 	NUMBER, 
    DTDEVAGENDRECURCON 	DATE, 
   NRORG              		NUMBER 		DEFAULT 1 NOT NULL,
   IDATIVO            		VARCHAR2(1) 	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_DEVAGENDRECURCON  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_DEVAGENDRECURCON ADD CONSTRAINT PK_FCT_DEVAGENDRECURCON PRIMARY KEY (NRDEVAGENDRECURCON)
/
ALTER TABLE FCT_DEVAGENDRECURCON 
  ADD CONSTRAINT FKSM00041AGENDRECCON FOREIGN KEY (NRRECURSOSAGENDCONT)
      REFERENCES FCT_RECURSOSAGENDCONT (NRRECURSOSAGENDCONT)
/
CREATE TABLE FCT_APROPAGENDAMENTO    (
   NRAPROPAGENDAMENTO  	NUMBER 		NOT NULL,
   NRRECURSOSAGENDCONT 	NUMBER 		NOT NULL, 
   NRPARCNEGRECURSO 	NUMBER 		NOT NULL,
   DTAPROPRIACAO 		DATE 		NOT NULL,
   IDSTATUSAPROPRIACAO 	NUMBER,
   QTHORASAPROPRIADAS  	FLOAT(126),
   NRPARCINTERLOCUTOR  	NUMBER,
   NRORG              		NUMBER 		DEFAULT 1 NOT NULL,
   IDATIVO            		VARCHAR2(1) 	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_APROPAGEND 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_APROPAGENDAMENTO ADD CONSTRAINT PK_FCT_APROPAGENDAMENTO PRIMARY KEY (NRAPROPAGENDAMENTO)
/
ALTER TABLE FCT_APROPAGENDAMENTO 
  ADD CONSTRAINT FKSM00042AGENDRECCONT FOREIGN KEY (NRRECURSOSAGENDCONT)
    REFERENCES FCT_RECURSOSAGENDCONT (NRRECURSOSAGENDCONT)
/
ALTER TABLE FCT_APROPAGENDAMENTO 
  ADD CONSTRAINT FKSM00043PARCNEGREC FOREIGN KEY (NRPARCNEGRECURSO)
    REFERENCES PARCNEGOCIO (NRPARCNEGOCIO)
/
ALTER TABLE FCT_APROPAGENDAMENTO 
  ADD CONSTRAINT FKSM00044PARCNEGOCIO FOREIGN KEY (NRPARCINTERLOCUTOR)
    REFERENCES PARCNEGOCIO (NRPARCNEGOCIO)
/
ALTER TABLE FCT_APROPAGENDAMENTO ADD CONSTRAINT CKC_IDSTATUSAPROPRIACAO CHECK (IDSTATUSAPROPRIACAO IN ('1','2','3')) 
/
CREATE TABLE FCT_APONTAMENTOAPROPAGEN (
   NRAPONTAMENTOAPROPAGEN NUMBER 	NOT NULL,
   NRAPROPAGENDAMENTO 	NUMBER 		NOT NULL, 
   IDTIPOAPONTAMENTO 	CHAR(1) 		NOT NULL,
   IDMOTIVOSAIDA 		CHAR(1),
   DTHRINICIOAPONT 	DATE,
   DTHRFIMCIOAPONT 	DATE,
   QTTEMPOAPONT 		FLOAT(126),
   DSOBSAPONTAMENTO 	VARCHAR2(4000),
   NRORG              		NUMBER 		DEFAULT 1 NOT NULL,
   IDATIVO            		VARCHAR2(1) 	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_APONTAPROPAGEN 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_APONTAMENTOAPROPAGEN ADD CONSTRAINT PK_FCT_APONTAMENTOAPROPAGEN PRIMARY KEY (NRAPONTAMENTOAPROPAGEN)
/
ALTER TABLE FCT_APONTAMENTOAPROPAGEN 
  ADD CONSTRAINT FKSM00045APROPGEND FOREIGN KEY (NRAPROPAGENDAMENTO)
    REFERENCES FCT_APROPAGENDAMENTO (NRAPROPAGENDAMENTO)
/
ALTER TABLE FCT_APONTAMENTOAPROPAGEN ADD CONSTRAINT CKC_IDTIPOAPONTAMENTO CHECK (IDTIPOAPONTAMENTO IN ('1','2','3')) 
/
ALTER TABLE FCT_APONTAMENTOAPROPAGEN ADD CONSTRAINT CKC_IDMOTIVOSAIDA CHECK (IDMOTIVOSAIDA IN ('1','2','3')) 
/
CREATE TABLE FCT_ANEXOAPONTAMENTO  (
   NRANEXOAPONTAMENTO 	NUMBER 		NOT NULL,
   NRAPONTAMENTOAPROPAGEN NUMBER 	NOT NULL,
   NMARQUIVO 		VARCHAR2(300) 	NOT NULL, 
   DSCAMINHO 		VARCHAR2(1000), 
   DSTIPO 			VARCHAR2(50), 
   VRTAMANHO 		FLOAT(126), 
   NRORG              		NUMBER 		DEFAULT 1 NOT NULL,
   IDATIVO            		VARCHAR2(1) 	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_ANEXOAPONT 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_ANEXOAPONTAMENTO ADD CONSTRAINT PK_FCT_ANEXOAPONTAMENTO PRIMARY KEY (NRANEXOAPONTAMENTO)
/
ALTER TABLE FCT_ANEXOAPONTAMENTO 
  ADD CONSTRAINT FKSM00046APONTAPROP FOREIGN KEY (NRAPONTAMENTOAPROPAGEN)
    REFERENCES FCT_APONTAMENTOAPROPAGEN (NRAPONTAMENTOAPROPAGEN)
/
CREATE TABLE FCT_TAREFASAGENDCONT  (
   NRTAREFASAGENDCONT 	NUMBER 		NOT NULL,
   NRRECURSOSAGENDCONT 	NUMBER 		NOT NULL,
   IDORDENACAO 		NUMBER, 
   DTTAREFA 		DATE,
   IDHORATAREFA 		FLOAT(126),
   DSREFETAREFA 		VARCHAR2(250), 
   DSTAREFA 		VARCHAR2(4000), 
   NRORG              		NUMBER 		DEFAULT 1 NOT NULL,
   IDATIVO            		VARCHAR2(1) 	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_TARSAGENDCONT 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_TAREFASAGENDCONT ADD CONSTRAINT PK_FCT_TAREFASAGENDCONT PRIMARY KEY (NRTAREFASAGENDCONT)
/
ALTER TABLE FCT_TAREFASAGENDCONT 
  ADD CONSTRAINT FKSM00047AGENDRECCONT FOREIGN KEY (NRRECURSOSAGENDCONT)
    REFERENCES FCT_RECURSOSAGENDCONT (NRRECURSOSAGENDCONT)
/
CREATE TABLE FCT_SOLICITARRECAGEND   (
   NRSOLICITARRECAGEND	NUMBER 		NOT NULL,
   NRAGENDRECURSOCONT  	NUMBER 		NULL,
   NRRECURSOSAGENDCONT 	NUMBER 		NULL,
   IDSITUSOLICITACAO 	CHAR(1) 		NOT NULL,
   DSREFERECURSO 		VARCHAR2(126),
   QTRECSOLICITACAO 	FLOAT(126), 
   DSSOLICITACAO 		VARCHAR2(4000), 
   NRORG              		NUMBER 		DEFAULT 1 NOT NULL,
   IDATIVO            		VARCHAR2(1) 	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_SOLRECAGEND 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_SOLICITARRECAGEND ADD CONSTRAINT PK_FCT_SOLICITARRECAGEND PRIMARY KEY (NRSOLICITARRECAGEND)
/
ALTER TABLE FCT_SOLICITARRECAGEND 
  ADD CONSTRAINT FKSM00049AGENDRECURSOCONT FOREIGN KEY (NRAGENDRECURSOCONT)
    REFERENCES FCT_AGENDRECURSOCONT (NRAGENDRECURSOCONT)
/
ALTER TABLE FCT_SOLICITARRECAGEND 
  ADD CONSTRAINT FKSM00050RECAGENDCONT FOREIGN KEY (NRRECURSOSAGENDCONT)
    REFERENCES FCT_RECURSOSAGENDCONT (NRRECURSOSAGENDCONT)
/
ALTER TABLE FCT_SOLICITARRECAGEND ADD CONSTRAINT CKC_IDSITUSOLICITACAO CHECK (IDSITUSOLICITACAO IN ('1','2','3', '4')) 
/
ALTER TABLE FCT_RELACESTRUTURACONT ADD CONSTRAINT FKSM00054CONTRATO FOREIGN KEY (NRSEQCONTRATO, NRORG) REFERENCES FCT_CONTRATO (NRSEQCONTRATO, NRORG)
/
ALTER TABLE FCT_RELACESTRUTURACONT ADD CONSTRAINT FKSM00055ITEMCONTRATO FOREIGN KEY (NRITEMOCONTRATO, NRORG) REFERENCES FCT_ITEMCONTRATO (NRITEMOCONTRATO, NRORG)
/
ALTER TABLE FCT_TAREFASAGENDCONT MODIFY (
  IDHORATAREFA VARCHAR2(10) DEFAULT NULL
)
/
CREATE TABLE FCT_TAREFAHABILI (
  NRTAREFAHABILI NUMBER(10) NOT NULL, 
  CDHABILITSERV NUMBER(10) NOT NULL, 
  IDORDENACAO NUMBER(10) DEFAULT NULL NULL, 
  IDHORATAREFA VARCHAR2(10) DEFAULT NULL NULL, 
  DSREFETAREFA VARCHAR2(250) DEFAULT NULL NULL, 
  DSTAREFA VARCHAR2(4000) DEFAULT NULL NULL, 
  NRORG NUMBER(10) DEFAULT 1 NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NULL, 
  DTINCLUSAO DATE NOT NULL, 
  DTULTATU DATE NOT NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NOT NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NOT NULL, 
  CDOPERINCLUSAO NUMBER(10) DEFAULT 1 NOT NULL, 
  CDOPERULTATU NUMBER(10) DEFAULT 1 NOT NULL,
  CONSTRAINT PK_FCT_TAREFAHABILI PRIMARY KEY(NRORG, NRTAREFAHABILI)
)
/
ALTER TABLE FCT_TAREFAHABILI ADD CONSTRAINT FKSM00056HABILITSERV FOREIGN KEY (CDHABILITSERV, NRORG) REFERENCES FCT_HABILITSERV (CDHABILITSERV, NRORG)