I'm running a python script that makes modifications in a specific database. I want to run a second script once there is a modification in my database (local server).
Is there anyway to do that?
Any help would be very appreciated. Thanks!
I'm running a python script that makes modifications in a specific database. I want to run a second script once there is a modification in my database (local server).
Is there anyway to do that?
Any help would be very appreciated. Thanks!
You can use 'Stored Procedures' in your database a lot of RDBMS engines support one or multiple programming languages to do so. AFAIK postgresql support signals to call external process to. Google something like 'Stored Procedures in Python for PostgreSQL' or 'postgresql trigger call external program'
Thanks for your answers, i found a solution here:
http://crazytechthoughts.blogspot.fr/2011/12/call-external-program-from-mysql.html
A Trigger must be defined to call an external function once the DB Table is modified:
Here, to call my python script, I use 'sys_exec' which is a UDF (User Defined Function). You can download the library from here: https://github.com/mysqludf/lib_mysqludf_sys