CREATE TABLE FCM_TAREFARECORRENTE (
    NRTAREFARECORRENTE    NUMBER 		  NOT NULL,
    NMTAREFA              VARCHAR2(250),
    TPLOCALTAREFA         VARCHAR2(100),
    LOCALTAREFA           VARCHAR2(100),
    NRCHECKLIST           NUMBER,
    ITENSCHECKLIST        VARCHAR2(100),
    ESCOPOSTAREFA         VARCHAR2(100),
    ITENSTAREFA           VARCHAR2(100),
    CRITERIOS             VARCHAR2(100),
    DIASSEMANA            VARCHAR2(35),
    HORARIO               VARCHAR2(10),
    DURACAO               VARCHAR2(10),
    NRFUNCTAREFA          NUMBER,
    NRFUNCVISTORIA        NUMBER,
    IDCRIARVISTORIA       CHAR(1),
    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_FCM_TAREFAREC CHECK (IDATIVO IN ('S','N'))
)
/

ALTER TABLE FCM_TAREFARECORRENTE ADD CONSTRAINT PK_FCM_TAREFARECORRENTE PRIMARY KEY (NRTAREFARECORRENTE)
/