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