Re: adding automatic alert

2005-01-07 Thread Aji Andri

--- Roger Baklund [EMAIL PROTECTED] wrote:

 Aji Andri wrote:
  Hi all,
  I'm make an inventory goods database, in one of my
  table I need to make an automatic alert when my
 stock
  reach it's limit (say for tires it's limit is 4),
 can
  I make an automatic alert for it so when it reach
 it
  limit I can have an alert may be a beep  or a
dialog box ?
 
 This is a typical task for the programming
 language/tool you are using 
 to create your application. What you ask may look a
 bit like a task for 
 a trigger, but triggers work serverside, and I
 assume you want the beep 
 on the client. I really think you would be better of
 just using a simple 
 script, running every 30 minutes or so. Something
 like this (meta code):
 
 cnt = select stock from goods where
 goodstype='tires'
 if (cnt  5):
 beep()
 send_email('[EMAIL PROTECTED]','Out of tires!')
 
 (This script will of course keep beeping/sending
 emails every 30 minutes 
 until you stop the script or increase the registered
 stock above the 
 limit... )
 
 -- 
 Roger
(sorry Roger for mis-sending, I think it was send to
list, :-) )
 





__ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

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



adding automatic alert

2005-01-06 Thread Aji Andri
Hi all,
I'm make an inventory goods database, in one of my
table I need to make an automatic alert when my stock
reach it's limit (say for tires it's limit is 4), can
I make an automatic alert for it so when it reach it
limit I can have an alert may be a beep  ?


Thanks



__ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 


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



Re: adding automatic alert

2005-01-06 Thread Roger Baklund
Aji Andri wrote:
Hi all,
I'm make an inventory goods database, in one of my
table I need to make an automatic alert when my stock
reach it's limit (say for tires it's limit is 4), can
I make an automatic alert for it so when it reach it
limit I can have an alert may be a beep  ?
This is a typical task for the programming language/tool you are using 
to create your application. What you ask may look a bit like a task for 
a trigger, but triggers work serverside, and I assume you want the beep 
on the client. I really think you would be better of just using a simple 
script, running every 30 minutes or so. Something like this (meta code):

cnt = select stock from goods where goodstype='tires'
if (cnt  5):
   beep()
   send_email('[EMAIL PROTECTED]','Out of tires!')
(This script will of course keep beeping/sending emails every 30 minutes 
until you stop the script or increase the registered stock above the 
limit... )

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


Re: adding automatic alert

2005-01-06 Thread Alec . Cawley
Roger Baklund [EMAIL PROTECTED] wrote on 06/01/2005 12:25:31:

 Aji Andri wrote:
  Hi all,
  I'm make an inventory goods database, in one of my
  table I need to make an automatic alert when my stock
  reach it's limit (say for tires it's limit is 4), can
  I make an automatic alert for it so when it reach it
  limit I can have an alert may be a beep  ?
 
 This is a typical task for the programming language/tool you are using 
 to create your application. What you ask may look a bit like a task for 
 a trigger, but triggers work serverside, and I assume you want the beep 
 on the client. I really think you would be better of just using a simple 

 script, running every 30 minutes or so. Something like this (meta code):
 
 cnt = select stock from goods where goodstype='tires'
 if (cnt  5):
 beep()
 send_email('[EMAIL PROTECTED]','Out of tires!')
 
 (This script will of course keep beeping/sending emails every 30 minutes 

 until you stop the script or increase the registered stock above the 
 limit... )

Or, more generally, add a column min_stock to the table so that it will 
check all lines: 

 cnt = select stock from goods where stock  min_stock ;
 if (cnt  5):
 beep()
 send_email('[EMAIL PROTECTED]','Restock needed for items')


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



Re: adding automatic alert

2005-01-06 Thread Rhino

- Original Message - 
From: Aji Andri [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Thursday, January 06, 2005 5:16 AM
Subject: adding automatic alert


 Hi all,
 I'm make an inventory goods database, in one of my
 table I need to make an automatic alert when my stock
 reach it's limit (say for tires it's limit is 4), can
 I make an automatic alert for it so when it reach it
 limit I can have an alert may be a beep  ?

The functionality you are describing is normally accomplished via a
technique called a 'trigger'.

MySQL is supposed to support triggers beginning in Version 5. An alpha of
Version 5 is currently available for download but I'm not sure if it is
mature enough for you to consider in a production environment. Also, I don't
know if triggers are actually present in the Version 5 code and are working.
Someone who has used Version 5 may be able to tell you that.

There may be other ways to accomplish the same functionality in MySQL 3.* or
4.*. I'll leave it to others to tell you if they have thought of ways to do
that.

Rhino


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