例如,如果我有一个表员工触发器。我想从表部门创建一个游标循环。然后我想获取属性并将其插入表公司。我猜答案是否定的,因为我得到一个运行时错误,说找不到表部门,但是有什么办法可以解决这个问题吗?
CREATE TRIGGER myTrigger AFTER INSERT
ORDER 1 ON dba.employee
REFERENCING NEW AS newRow
FOR EACH ROW
BEGIN
FOR myloop AS getIDCursor INSENSITIVE CURSOR FOR SELECT department_id FROM department
DO
INSERT INTO company (...) VALUES (...);
END FOR
END