例如
CREATE GLOBAL TEMPORARY TABLE GGT_temp_reversal
(
sessionid VARCHAR (50) NULL,
syspk NUMERIC (23)
)
ON COMMIT DELETE ROWS ;
CREATE SEQUENCE GGT_temp_reversal_seq;
CREATE OR REPLACE TRIGGER GGT_temp_reversal_bir
BEFORE INSERT ON GGT_temp_reversal
FOR EACH ROW
WHEN (new.id IS NULL)
BEGIN
:new.id := GGT_temp_reversal_seq.NEXTVAL;
END;
获取错误"%s:无效的标识符"
答案 0 :(得分:4)
您正在为ID列
创建触发器:new.id:= GGT_temp_reversal_seq.NEXTVAL;
但是你没有在CREATE TABLE中声明它
CREATE GLOBAL TEMPORARY TABLE GGT_TEMP_REVERSAL (
SESSIONID VARCHAR(50) NULL,
SYSPK NUMERIC(23)
)
添加ID列,没关系