/******************************************************************************/
/***               Generated by IBExpert 06/08/2021 17:18:54                ***/
/******************************************************************************/

/******************************************************************************/
/***      Following SET SQL DIALECT is just for the Database Comparer       ***/
/******************************************************************************/
SET SQL DIALECT 3;

/******************************************************************************/
/***                                 Tables                                 ***/
/******************************************************************************/

CREATE GENERATOR PQ_MANIFESTARNOTASEVENTOS;


CREATE TABLE MANIFESTARNOTASEVENTOS (
    ID       INTEGER NOT NULL,
    NRNOTA varchar(12),
    CHAVENFE varchar(60),
    DATA date,
    PROTOCOLO varchar(60),
    XML BLOB SUB_TYPE 0 SEGMENT SIZE 80,
    CODIGOSTATUS integer,
    MOTIVO varchar(200),
    IDEVENTO integer,
    EVENTO varchar(30),
    XMLRETORNO BLOB SUB_TYPE 0 SEGMENT SIZE 80,
    MSGRETORNO varchar(100),
    IDEMPRESA integer
);




/******************************************************************************/
/***                              Primary keys                              ***/
/******************************************************************************/

ALTER TABLE MANIFESTARNOTASEVENTOS ADD CONSTRAINT PK_MANIFESTARNOTASEVENTOS PRIMARY KEY (ID);


/******************************************************************************/
/***                                Triggers                                ***/
/******************************************************************************/



SET TERM ^ ;



/******************************************************************************/
/***                          Triggers for tables                           ***/
/******************************************************************************/



/* Trigger: INSUNIDADES */
CREATE OR ALTER TRIGGER INSMANIFESTARNOTASEVENTOS FOR MANIFESTARNOTASEVENTOS
ACTIVE BEFORE INSERT POSITION 0
as 
begin 
   new.ID=gen_id(PQ_MANIFESTARNOTASEVENTOS,1);
end
^


SET TERM ; ^



/******************************************************************************/
/***                               Privileges                               ***/
/******************************************************************************/




