I am trying to run an INSERT
statement on table X each time I SELECT
any record from table Y is there anyway that I can accomplish that using MySQL only?
Something like triggers?
No there is no provision of having trigger on SELECT operation. As suggested in earlier answer, write a stored procedure which takes parameters that are fetched from SEECT query and call this procedure after desired SELECT query.
Nope - you can't trigger on SELECT - you'll have to create a stored procedure (or any other type of logging facility - like a log file or what ever) that you implicitly call on any query statement - easier if you create a wrapper that calls your query, calls the logging and returns query results.
This is not possible.
Short answer is No. Triggers are triggered with INSERT
, UPDATE
or DELETE
.
Possible solution for this. rather rare scenario:
SELECT
s you want on table X.SELECT
on table X.INSERT
or whatever).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With