views:

81

answers:

1

Hi Friends

i have a tow table name t1,t2 . Based on the value insert in t1 i want to insert in t2 . i use the following trigger .

create trigger testt after insert on t1
BEGIN
for each row
if NEW.uid='Mill' then insert into t2 (uid2) values (NEW.uid)
end if
 if NEW.uid='Farm' then insert into t2 (uid2) values (NEW.r)
end if
END

Please help me to resolve this issue . Thanks in advance

A: 

It looks like you just have some keywords out of order:

CREATE TRIGGER ...
FOR EACH ROW 
BEGIN
    ...
END
Bill Karwin
just for reference i added that BEGIN and END keyword , Actually i haven't use that .
Sakthivel
Why did you include keywords that you haven't used? It's hard to answer a question by mind-reading. Please edit your question and be clear about what you *actually* tried, and what the issue is that you are trying to resolve.
Bill Karwin