MySQL Forums
Forum List  »  Triggers

Trigger to Delete all records from a table
Posted by: Dan Norh
Date: February 15, 2011 03:01PM

First off, let me preface this by saying I'm completely new to triggers.

I'm using a MySQL database for reporting purposes, using data coming out of our FoxPro ERP system.

When i need to update the data in MySQL, I'm currently running "DELETE * from table" query in MSACCESS followed by an INSERT query to repopulate the table.

Some of these tables are huge, and this can take a minute or two to run.

I'm thinking maybe I could create a trigger to automatically do the DELETE step when i run the INSERT query from Access. My assumption is that it would run faster this way.

My question is, in reading online, it looks like the trigger might run before every line is inserted. Is that the case? I just want the delete trigger to run once at the first INSERT.

Is this possible? Is this even a good approach????

Thanks!

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger to Delete all records from a table
3877
February 15, 2011 03:01PM


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.