CREATE TABLE HISTLOGCOMPCARD ( 
    CDFILIAL 		VARCHAR2(4) 	NULL,
    CDSERVFILI 		VARCHAR2(5) 	NULL,
    DTMESCARD 		DATE NULL, 
    DTCARDAPIO 		DATE NULL,
    CDTIPOPRAT 		VARCHAR2(2) 	NULL,
    CDPRATOANT 		VARCHAR2(10) 	NULL,
    CDPRATOATUAL 	VARCHAR2(10) 	NULL,
    CDOPERADOR 		VARCHAR2(12) 	NULL,
    IDOPERACAO 		VARCHAR2(1) 	NULL,
    DTALTERACAO 	DATE 			NULL,
	NRORG           NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
	IDATIVO         VARCHAR2(1)     DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_HISTLOGCOMPCARD 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'
)
/

ALTER TABLE TIPOOPERAC ADD IDREGESPECIAL VARCHAR2(1) NULL