firebird数据库主键自动生成

CREATE GENERATOR GEN_QAS_REPORT_ID

 

 

SET TERM ^ ;
CREATE TRIGGER TRIGGER_QAS_REPORT FOR QAS_REPORT ACTIVE
BEFORE INSERT POSITION 0
AS
BEGIN
        NEW.REPORT_ID = GEN_ID(GEN_QAS_REPORT_ID , 1);
END^
SET TERM ; ^

你可能感兴趣的:(数据库)