When a new record is added to a specific table, I want to
react to it right away, running a perl script to do something.

Right now, I use a cronjob that checks the table every minuet.
It is slow(it could waits up to a whole min.) and not efficient.

To my understanding, I would need to put a trigger on this table. When the trigger
is triggered, it will call the same perl script through UDF. Not sure
whether I get it right.

ted



On Jun 27, 2005, at 12:19 PM, Michael Kruckenberg wrote:

On Jun 27, 2005, at 1:32 PM, Ted Zeng wrote:
I don't know if it is possible under Mac OS. But I assume it is,
consider it is basically a UNIX.

I just want to trigger a shell script, say, a perl script.
Could a shell script be called from a C program?
It looks like I will need to go through a lot of stuff to do this.
Just remember that this shell script will be called for every record involved in the database action. If up do an update on the table that affects 1000 rows, the database will go through the process of calling the UDF and associated system calls for each of the 1000 rows. This will degrade database performance.

What it is you are trying to accomplish with the shell script? Perhaps it could be pulled into the UDF, or into some other mechanism.

On Jun 24, 2005, at 2:42 PM, [EMAIL PROTECTED] wrote:

Isn't this what a User Defined Function would be used for? Your trigger
would call the UDF which would do a system().

Or is this not possible under Mac OS?

-Lee

Gleb Paharenko <[EMAIL PROTECTED]>


I don't know any SQL statements which could launch extern commands,
at least in MySQL. So in triggers it is impossible as well.



Ted Zeng <[EMAIL PROTECTED]> wrote:


Hi,

I am using MySql on Mac OS X.
I am wondering if I could execute a command (shell, perl) by a Trigger.
I read the manual and it seems this is impossible.

ted



Mike Kruckenberg
[EMAIL PROTECTED]
"ProMySQL" Author
http://promysql.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to