MySQL Forums
Forum List  »  Triggers

problem with trigger
Posted by: patrick83
Date: January 07, 2006 06:05PM

Hello
i've got a problem with a trigger.
there are two tables: pkw and ausleihe. After I have updated the table ausleihe, the trigger starts and it shell search in every row in the table ausleihe, if a number is more than 100000 in the column end_km. If this is so, the trigger should update the table pkw by change the boolean into true of the column ausser_betrieb (the number of end_km in the table ausleihe is the same like kilometer in pkw).

Here is my actual trigger:
create trigger betriebspruefung after update on ausleihe
for each row
begin
-- if kilometer >= 100000 then
update pkw set ausser_betrieb = true where new.end_km = kilometer;
-- end if;
end;

The if-Condition and the where-causal isn't right and I don't no what to da.

tables:
PKW(kilometer, ausser_betrieb, ....)
ausleihe(end_km, ...).

If you want I could also send the whole Database.

Options: ReplyQuote


Subject
Views
Written By
Posted
problem with trigger
2481
January 07, 2006 06:05PM
1774
January 09, 2006 02:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.