CREATE OR REPLACE TRIGGER SAL_CHGOWN AFTER INSERT ON SAL_CHGOWN FOR EACH ROW declare cursor t_sor(id datatype) is select * from sal_chgown where sal_chgown_id=id; r_salchgown sal_chgown%rowtype; BEGIN for v_sor in t_sor(:new.sal_chgown_id) loop r_salchgown:=v_sor; end loop; END;试试看!
open r_salchgown for
select * from sal_chgown where sal_chgown_id = :new.sal_chgown_id
1、select * into r_salchgown from sal_chgown where sal_chgown_id = :new.sal_chgown_id;----没有分号结束2、所选的查询可能出现多条记录。
AFTER INSERT
ON SAL_CHGOWN
FOR EACH ROW
declare
cursor t_sor(id datatype) is
select * from sal_chgown
where sal_chgown_id=id;
r_salchgown sal_chgown%rowtype;
BEGIN
for v_sor in t_sor(:new.sal_chgown_id) loop
r_salchgown:=v_sor;
end loop;
END;试试看!