CREATE TABLE FPA_FORMCALCCOMPL
 (
   NRFORMCALCCOMPL 	NUMBER 		NOT NULL,
   NMFORMCALCULO 	VARCHAR2(100) 	NOT NULL,
   DSORDEM 		VARCHAR2(100) 	NOT NULL, 
   DSINICIO 		VARCHAR2(2000) 	NOT NULL, 
   DSFIM 			VARCHAR2(2000),
   DTPAGAMENTO 		DATE 		NOT NULL,
   IDULTPGTOMES 		VARCHAR2(1) 	DEFAULT 'S' NOT NULL,
   IDMEMORIACALC 	VARCHAR2(1) 	DEFAULT 'S' NOT NULL,
   CDGRUPOPER 		VARCHAR2(2) 	DEFAULT 'S' NOT NULL,
   NRORG                       	NUMBER 		DEFAULT 	 SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
   IDATIVO                   	VARCHAR2(1)     	DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_FPA_FORCALCOM 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',
   CDOPERADOR 		VARCHAR2(12),
   IDDIFSAL 		VARCHAR2(1),
   IDDIFFERIAS 		VARCHAR2(1), 
   DTINI 			DATE,
   DTFIM 			DATE,
   VRSALDISSIDIO 		FLOAT(126),
   IDFAZDIFCOMP 		VARCHAR2(1) 	DEFAULT 'N' NOT NULL,
 	CONSTRAINT PK_FPA_FORMCALCCOMPL PRIMARY KEY (NRFORMCALCCOMPL),
 	CONSTRAINT CKC_IDDIFSAL_FORCALCOM CHECK (IDDIFSAL IN ('S','N')),
 	CONSTRAINT CKC_IDFAZDIFCOMP_FORCALCOM CHECK (IDFAZDIFCOMP IN ('S','N')),
 	CONSTRAINT CKC_IDDIFFERIAS_FORCALCOM CHECK (IDDIFFERIAS IN ('S','N'))
)
/
ALTER TABLE GPE_PARAMORG ADD DSHOSTSMTP VARCHAR2(500)
/
ALTER TABLE GPE_PARAMORG ADD DSEMAILSMTP VARCHAR2(500)
/
ALTER TABLE GPE_PARAMORG ADD DSSENHASMTP VARCHAR2(50)
/
ALTER TABLE GPE_PARAMORG ADD DSPORTASMTP VARCHAR2(50)
/
ALTER TABLE CONTATO ADD IDARQUIVADO VARCHAR2(1) DEFAULT 'N' NOT NULL
	CONSTRAINT CKC_IDARQUIVADO_CONTATO CHECK (IDARQUIVADO IN ('N','S'))
/
ALTER TABLE DESPADMFATUR ADD CDORDEMDESPFAT  VARCHAR2(10) NULL
/
CREATE TABLE DES_PARAMFASE 
(
   NRPARAMFASE    		NUMBER 		NOT NULL, 
   NRORG          		NUMBER 		DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL, 
   IDATIVO                   	VARCHAR2(1)     	DEFAULT 'S' NOT NULL,
      CONSTRAINT CKC_IDATIVO_DES_PARAMFASE  CHECK (IDATIVO IN ('S','N')),
   NRFASE 		NUMBER 		NOT NULL, 
   NRCRITERIORESUL 	NUMBER,
   VRFASE 		NUMBER, 
   NRDURACAO 		NUMBER,
   NRPESO 		NUMBER, 
   IDOBRIGATORIO 		VARCHAR2(1) NOT NULL, 
   DTINCLUSAO 		DATE NOT NULL, 
   DTULTATU 		DATE, 
   NRORGINCLUSAO 	NUMBER, 
   CDOPERINCLUSAO 	VARCHAR2(12) NOT NULL, 
   NRORGULTATU		NUMBER, 
   CDOPERULTATU 		VARCHAR2(12), 
	CONSTRAINT DES_PARAMFASE_PK PRIMARY KEY(NRPARAMFASE)
)
/
ALTER TABLE GPE_TREINAMENTO MODIFY NRPARCNEGAPROV NULL