[firebase-br] Problemas com AutoIncrement e INSERT
Osvaldo
cslinf em uol.com.br
Qui Jun 29 12:04:08 -03 2006
Aqui vai o texto pelo IB EXPERT, tudo foi criado direito, pelo menos eu acho
Osvaldo P.G.U.
================================================================
CREATE GENERATOR GEN_TB_MIDIA_ID;
CREATE TABLE TB_MIDIA (
ID_MIDIA DM_INTEIRO NOT NULL /* DM_INTEIRO = INTEGER DEFAULT 0 */,
DS_MIDIA DM_VC40 /* DM_VC40 = VARCHAR(40) */,
CD_MIDIA DM_CH02 /* DM_CH02 = CHAR(2) */
);
/***************************************************************************
***/
/*** Primary Keys
***/
/***************************************************************************
***/
ALTER TABLE TB_MIDIA ADD CONSTRAINT PK_TB_MIDIA PRIMARY KEY (ID_MIDIA);
/***************************************************************************
***/
/*** Triggers
***/
/***************************************************************************
***/
SET TERM ^ ;
/***************************************************************************
***/
/*** Triggers for tables
***/
/***************************************************************************
***/
/* Trigger: TB_MIDIA_BI */
CREATE TRIGGER TB_MIDIA_BI FOR TB_MIDIA
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.ID_MIDIA IS NULL) THEN
NEW.ID_MIDIA = GEN_ID(GEN_TB_MIDIA_ID,1);
END
^
SET TERM ; ^
Mais detalhes sobre a lista de discussão lista