0
我一直遇到问题,即在附加了触发器后将值插入表中。 触发如下:DB2 SQL - 在触发器生成后无法成功插入表
CREATE TRIGGER trig
AFTER INSERT ON Follows
REFERENCING NEW as N
FOR EACH row
WHEN ((Select email from Celebrity) <> N.followed_email)
UPDATE followSuggestion SET followSuggestion.Suggested_follower = N.followed_email, followSuggestion.Suggested_followee = N.follower_email
;
插入代码如下:
INSERT INTO follows
VALUES('[email protected]','[email protected]');
,误差如下
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0811N The result of a scalar fullselect, SELECT INTO statement, or VALUES
INTO statement is more than one row. SQLSTATE=21000
SQL0811N The result of a scalar fullselect, SELECT INTO statement, or VALUES INTO statement is more than one row.
谢谢先进!
非常好的一点,非常感谢您的简洁明确的答案! – Quentin