/* Table: BUGLOG */
CREATE TABLE BUGLOG (
BUGIDE INTEGER NOT NULL,
BUGURI VARCHAR (60) CHARACTER SET NONE COLLATE NONE,
BUGMSG VARCHAR (300) CHARACTER SET NONE COLLATE NONE,
BUGQRY VARCHAR (500) CHARACTER SET NONE COLLATE NONE,
BUGSTA TIMESTAMP);
/* Primary keys definition */
ALTER TABLE BUGLOG ADD CONSTRAINT PK_BUGLOG PRIMARY KEY (BUGIDE);
SET TERM ^ ;
/* Let's create a Generator variable to store the autoincremental IDE */
CREATE GENERATOR "BUGLOG_BUGIDE_GEN";
/* Triggers definition */
/* Trigger: AI_BUGLOG_BUGIDE :AUTO_INCREMENT IDE */
CREATE TRIGGER AI_BUGLOG_BUGIDE FOR BUGLOG ACTIVE
BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.BUGIDE IS NULL) THEN
NEW.BUGIDE = GEN_ID(BUGLOG_BUGIDE_GEN, 1);
END
^
SET TERM ; ^
|