CREATE TABLE DESEMIAUTONFCE(
    NRSEQDESEMIAUTO   INTEGER        NOT NULL,
    NMSIGNATARIO      VARCHAR2(255)  NOT NULL,
    NRINSJURSIG       VARCHAR2(11)   NOT NULL,
    DSEMAIL           VARCHAR2(255)  NOT NULL,
    DSEMAILCOPIA      VARCHAR2(500)  NOT NULL,
    DTHRPEDIDO        DATE DEFAULT CURRENT_TIMESTAMP,
    IDHASH            VARCHAR2(64),
    IDASSINATURA      VARCHAR2(255),
    CDOPERADOR        VARCHAR2(255),
    DTHRASSINATURA    DATE 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_DESEMIAUTONFCE CHECK (IDATIVO IN ('S','N')),
		CONSTRAINT PK_DESEMIAUTONFCE PRIMARY KEY (NRSEQDESEMIAUTO )
)
/

CREATE SEQUENCE NRSEQDESEMIAUTO START WITH 1 MINVALUE 1 INCREMENT BY 1
/