MySQL Forums
Forum List  »  Triggers

update same table where trigger runs not possible ?
Posted by: Lao De
Date: April 01, 2011 06:37AM

Hi,

I am pretty much confused about the statements, that one can not create an update-trigger on the same table to update.

I found samples, who tell so in different variations:

http://www.java2s.com/Code/SQL/Trigger/ChangetheNEWvaluebasedontheinputinaBEFOREINSERTtrigger.htm

supposed I can't update same table with a trigger and I can't use variables in a view to display a cumulated-sum as seperate column, what technology should I use to have something like a refreshed current-sum according to an update ?

I can have a cumulated sum in a query, using a plain mySQL-statement:

select col1, col2, @cumul_sum:=@cumul_sum + price current_sum from turnover_tab;

but how to use that output (refreshed after update) in a front-end looking like a table ?

Thanks for any hint, LaoDe

Options: Reply• Quote


Subject
Views
Written By
Posted
update same table where trigger runs not possible ?
4260
April 01, 2011 06:37AM


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.