0

Is there a way of having a mysql stored procedure automatically execute following a mysql workbench data import, e.g. after an import of a recordset from a csv file?

The aim is to update a separate table that tracks activity.

gungu
  • 161
  • 1
  • 1
  • 9

2 Answers2

1

Triggers, that's what you are looking for. But be warned that mysql triggers operate at row level and it will fire the trigger once for each row. Which means bulk imports will be very very slow.

e4c5
  • 52,766
  • 11
  • 101
  • 134
1

Why don't you schedule your stored procedure with MySQL event scheduler which will run your stored proc in every 5 minutes of interval to track the activity.

First thing I want to confirm that scheduled events only works with MySQL version 5.6 .

Here is the links which may help you in scheduling procs:

http://www.mysqltutorial.org/mysql-triggers/working-mysql-scheduled-event/

How to schedule a stored procedure in MySQL

Community
  • 1
  • 1
Abhishek Ginani
  • 4,511
  • 4
  • 23
  • 35