0

I have been searching for a way that can help me notify the C code about successful INSERT operation fired over a Mysql table.

So the insert query is already there in other component code, now in an independent component I want to get notified when Insert on a particular table takes place so that I could fire select on the table. Currently I fire select query on particular interval, need to avoid that and instead do it after an insert query.

4
  • 1
    Does this answer your question? Using MySQL C API - check success of inserting rows using prepared statements Commented May 5, 2020 at 12:05
  • @P.Salmon No sir, Actually I already have insert query in other component code. Now I just want that to be notified in some other code when insert is fired on a particular table. Commented May 5, 2020 at 13:02
  • MySQL does not inform a client about modifications. It just responses to requests from clients (e.g. your c app). Instead of relying on an external server to do the talking, you have to modify your components to talk to each other. Commented May 5, 2020 at 13:51
  • @Solarflare okay. Noted. Commented May 6, 2020 at 6:36

1 Answer 1

0

Don't give users INSERT privilege to tables. Instead, make the go through an API -- either a Stored Procedure or a client API. There do any monitoring/etc you need.

Note that MySQL cannot (for security reasons) launch anything outside itself -- no email, callbacks, etc. There is an exception: UDFs (User Defined Functions).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.