Re: could a Trigger execute a outside command?

2005-06-27 Thread Ted Zeng

Thanks.  This info. is very useful to me.

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.

ted


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






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




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



Re: could a Trigger execute a outside command?

2005-06-27 Thread Ted Zeng

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]



Re: could a Trigger execute a outside command?

2005-06-27 Thread Ted Zeng

Jeremy,

Thanks. I used Perl's cron module to execute my script. So I assume
only the cron mdoule is active all the time, but not my perl script.

Your approach looks interesting to me. I will think about it.

ted zeng

On Jun 27, 2005, at 1:14 PM, Jeremy Cole wrote:


Hi Ted,


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.


Seems like a better approach might be:

* Build a UDF that sends a SIGALRM to your Perl script.
  - You can test this independently by calling it with SELECT.
  - This will mean getting the PID somehow.
  - Likely, the Perl script will need to write its PID somewhere.
  - You'll read the PID in your UDF and call kill(pid, SIGALRM)

* Write your Perl script so that it looks like so:

  while(1) {
do_work();
check if the while should be broken
sleep 60;
  }

* Upon receiving the SIGALRM, the Perl script will be woken up early 
and get to its work immediately.  If something fails for any reason, 
you go back to the old behaviour of checking every 60 seconds.


Regards,

Jeremy

--
Jeremy Cole
Technical Yahoo - MySQL (Database) Geek
Desk: 408 349 5104

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




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



could a Trigger execute a outside command?

2005-06-23 Thread Ted Zeng

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


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



need opinion on FmPro Migrator

2005-03-28 Thread Ted Zeng
Hi, all,
I need to convert databases from FileMaker to MySQL. I searched
the web and found this product
FmPro Migrator
I am wondering if people here have used it and know how well it works.
Or are there any other way to do the conversion out there?
Ted Zeng
Adobe Systems Inc.