Can I launch a trigger on select statement in mysql?

Short answer is No. Triggers are triggered with INSERT, UPDATE or DELETE.

Possible solution for this. rather rare scenario:

  • First, write some stored procedures
    that do the SELECTs you want on
    table X.
  • Then, restrict all users to use only
    these stored procedures and do not
    allow them to directly use SELECT on table
    X.
  • Then alter the stored procedures to
    also call a stored procedure that
    performs the action you want
    (INSERT or whatever).

Leave a Comment