CREATE TABLE FCT_ESCFATUREXCOM (
    NRESCFATUREXCOM   NUMBER 		  NOT NULL,
    NRTIPOORCAMENTO   NUMBER 		  NOT NULL,
    NRORG             NUMBER 	      DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 	NOT NULL,
    IDATIVO           VARCHAR2(1)     DEFAULT 'S' NOT NULL,
    DTINCLUSAO        DATE            DEFAULT SYSDATE,
    DTULTATU          DATE            DEFAULT SYSDATE,
    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 CKC_IDATIVO_FCT_ESCFAREXCOM CHECK (IDATIVO IN ('S','N')),
		CONSTRAINT PK_FCT_ESCFATUREXCOM PRIMARY KEY (NRESCFATUREXCOM)
)
/

CREATE INDEX SM00379_FK ON FCT_ESCFATUREXCOM (NRTIPOORCAMENTO ASC)
/

ALTER TABLE FCT_ESCFATUREXCOM 
  ADD CONSTRAINT FKSM00379TIPOORCA_ESCFAREXCOM FOREIGN KEY (NRTIPOORCAMENTO)
      REFERENCES FCT_TIPOORCAMENTO (NRTIPOORCAMENTO)
/