/******************************************************************************/
/***               Generated by IBExpert 17/02/2022 10:39:03                ***/
/******************************************************************************/

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



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

CREATE GENERATOR GEN_TRANSFPRODUTOSDET;

CREATE TABLE TRANSFPRODUTOSDET (
    ID             INTEGER DEFAULT 0 NOT NULL,
    IDTRANSFERENCIA  INTEGER,
    DATA           DATE,
    IDPRODUTO      INTEGER,
    CODIGO         VARCHAR(14),
    DESCRICAO      VARCHAR(150),
    QTDE           NUMERIC(14,2),
    UNITARIO       NUMERIC(14,2),
    TOTAL          NUMERIC(14,2),
    CONTROLE       VARCHAR(20)
);




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

ALTER TABLE TRANSFPRODUTOSDET ADD PRIMARY KEY (ID);


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



SET TERM ^ ;



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



/* Trigger: INSAGENDAMENTOSPROD */
CREATE OR ALTER TRIGGER INSTRANSFPRODUTOSDET FOR TRANSFPRODUTOSDET
ACTIVE BEFORE INSERT POSITION 0
AS
begin
   NEW.ID=GEN_ID(GEN_TRANSFPRODUTOSDET,1);
end
^

SET TERM ; ^



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


