MySQL Forums
Forum List  »  Triggers

Trigger HelpPlease
Posted by: David Guy
Date: July 07, 2015 04:33PM

Hi

I run a website donnyradar(dot)co(dot)uk
I need to be able to pick out aircraft that 'squawk' a certain code.
I have a number of tables, 2 of which are exactly the same called 'realtime' and 'airfields'
New data is constantly being inserted into 'realtime'
I have created two triggers that select the data that I require from 'realtime' and copy it into 'airfields'

My problem is that once the first few pieces of data are copied, data stops being entered into 'realtime'

My Triggers are as follows:

CREATE TRIGGER `airfields_insert` After INSERT ON `realtime`
FOR EACH ROW INSERT airfields SELECT * FROM realtime WHERE (squawk >=6160 and squawk <=6167) or (squawk >=6171 and squawk <=6177) AND altitude <=4000

CREATE TRIGGER `airfields_update` AFTER UPDATE ON `realtime`
FOR EACH ROW INSERT airfields SELECT * FROM realtime WHERE (squawk >=6160 and squawk <=6167) or (squawk >=6171 and squawk <=6177) AND altitude <=4000

My thoughts are that the trigger carries on running in the background instead of ending and firing again when the next data matches.

Any help/advice would be much appreciated

Thanks and Regards

Dave

www.donnyradar.co.uk

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger HelpPlease
1909
July 07, 2015 04:33PM
1229
July 07, 2015 10:26PM
1333
July 08, 2015 07:00AM
1178
July 08, 2015 09:42AM
1030
July 15, 2015 03:50AM
949
July 15, 2015 10:00AM


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.