<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>MySQL Forums - Events (Job Scheduler)</title>
        <description>Forum for Events and Scheduling</description>
        <link>http://forums.mysql.com/list.php?119</link>
        <lastBuildDate>Sun, 19 May 2013 21:22:23 +0000</lastBuildDate>
        <generator>Phorum 5.2.19</generator>
        <item>
            <guid>http://forums.mysql.com/read.php?119,585477,585477#msg-585477</guid>
            <title>Events and stored procedures (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,585477,585477#msg-585477</link>
            <description><![CDATA[ I already posted this question in the MySQL Docs forum, but thought more people might read it here. Although the sample code SEEMS to work OK, I'm mostly worried that there might be some kind of undefined behavior going on here because the documentation is so clear about stating that it really shouldn't work at all.<br />
<br />
We are using MySQL 5.1.69, and I'm a little confused about this bit from the documentation concerning events: <br />
<br />
&quot;An event may not be created, altered, or dropped by a stored routine, trigger, or another event. An event also may not create, alter, or drop stored routines or triggers. (Bug #16409, Bug #18896)&quot; <br />
<a href="http://dev.mysql.com/doc/refman/5.1/en/stored-program-restrictions.html#stored-routines-event-restrictions"  rel="nofollow">http://dev.mysql.com/doc/refman/5.1/en/stored-program-restrictions.html#stored-routines-event-restrictions</a> <br />
<br />
But I have seen numerous instances on the web which give code examples of stored procedures which contain ALTER EVENT statements. When I tried this myself, it seemed to work OK: <br />
<br />
<pre class="bbcode"><span style="color:blue">
CREATE DATABASE IF NOT EXISTS mydb;
USE mydb;

CREATE TABLE IF NOT EXISTS mydb.test_event ( 
id int(11) NOT NULL AUTO_INCREMENT, 
dummy varchar(1) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'x', 
PRIMARY KEY (id) 
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 

DELIMITER // 

CREATE EVENT mydb.event_test 
ON SCHEDULE EVERY 5 SECOND 
ON COMPLETION PRESERVE 
DISABLE 
DO insert into mydb.test_event (dummy) VALUES ('x'); 
// 

CREATE PROCEDURE mydb.enable_event() 
MODIFIES SQL DATA 
BEGIN 
ALTER EVENT mydb.event_test ENABLE; 
END// 

CREATE PROCEDURE mydb.disable_event() 
MODIFIES SQL DATA 
BEGIN 
ALTER EVENT mydb.event_test DISABLE; 
END// 

DELIMITER ; 

SET GLOBAL event_scheduler=ON;

-- verify that it is running:
SHOW PROCESSLIST;

-- output:
Id	User	Host	db	Command	Time	State	Info
105	phpmyadmin	localhost	NULL	Sleep	0	 	NULL
106	bob	localhost	mydb	Query	0	NULL	SHOW PROCESSLIST
107	event_scheduler	localhost	NULL	Daemon	0	Waiting on empty queue	NULL

CALL mydb.enable_event();

-- verify that the event is enabled:
SELECT * FROM test_event;

CALL mydb.disable_event();

set global event_scheduler=OFF;
SHOW PROCESSLIST;
</span></pre>
<br />
I have a different user account which has only SELECT and EXECUTE privileges on mydb. Assuming that the event scheduler is running, now that user can turn the event 'test_event' on and off, which was the whole purpose of this exercise. <br />
<br />
QUESTION: Does this work reliably? If so, why does this work if the documentation says it shouldn't?]]></description>
            <dc:creator>Robert Hairgrove</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Sat, 04 May 2013 10:37:54 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,585324,585324#msg-585324</guid>
            <title>Enabling Event scheduler gives &quot;start: Job failed to start&quot; error (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,585324,585324#msg-585324</link>
            <description><![CDATA[ I'm using mysqld Ver 5.5.22-0ubuntu1 for debian-linux-gnu on x86_64 ((Ubuntu)) under Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-24-generic x86_64). Updates are current.<br />
<br />
I had two events that were working fine, and then a power outage knocked the server out. Since then, mysql will not start if event_scheduler=ENABLED in /etc/mysql/my.cnf:<br />
<br />
# service mysql restart<br />
mysql stop/waiting<br />
start: Job failed to start<br />
<br />
I dropped both events from the events table, and /var/log/mysql.err is completely empty.<br />
<br />
Setting event_scheduler=DISABLED allows mysql to start fine.<br />
<br />
Any assistance would be greatly appreciated.]]></description>
            <dc:creator>Brian Jasperson</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Thu, 02 May 2013 16:08:50 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,582848,582848#msg-582848</guid>
            <title>MySQL auto update doesn't work (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,582848,582848#msg-582848</link>
            <description><![CDATA[ HI, <br />
<br />
I'm trying to do an automatically update using MySQL events.<br />
<br />
When I use datas from a single table, the update ends well, but when I use datas from other tables, the update doesn't work.<br />
<br />
Here is my event code : <br />
&quot;delimiter |<br />
<br />
create event test <br />
on schedule every 1 minute<br />
do<br />
begin <br />
  declare p,g,b,pp,pg,pb,i,ap,ag,ab,np,ng,nb,ep,eg,eb INT;<br />
  declare done INT default 0;<br />
  declare c cursor for select IDVILLAGE, PIERRE, GOLD, BOIS, PRODPIERRE, PRODGOLD, PRODBOIS, EPIERRE, EGOLD, EBOIS from VILLAGE;<br />
  declare continue handler for sqlstate '02000' set done = 1;<br />
  open c;<br />
  repeat<br />
    fetch c into i,p,g,b,pp,pg,pb,ep,eg,eb;<br />
    select ab.NIVEAUAMEL into ap from AMELBAT ab, BATIMENTVILLAGE bv where ab.IDBAT=bv.IDBATVIL and bv.IDVILLAGE=iv and ab.IDAMELIORATION in (79, 82, 85);<br />
    select ab.NIVEAUAMEL into ag from AMELBAT ab, BATIMENTVILLAGE bv where ab.IDBAT=bv.IDBATVIL and bv.IDVILLAGE=iv and ab.IDAMELIORATION in (80, 83, 86);<br />
    select ab.NIVEAUAMEL into ab from AMELBAT ab, BATIMENTVILLAGE bv where ab.IDBAT=bv.IDBATVIL and bv.IDVILLAGE=iv and ab.IDAMELIORATION in (81, 84, 87);<br />
    set p = p+(1+(ap/20))*pp;<br />
    set g = g+(1+(ag/20))*pg;<br />
    set b = b+(1+(ab/20))*pb;<br />
    if p&gt;ep then<br />
      set p=ep;<br />
    end if;<br />
    if g&gt;eg then<br />
      set g=eg;<br />
    end if;<br />
    if b&gt;eb then<br />
      set b=eb;<br />
    end if;<br />
    update VILLAGE set PIERRE=p, BOIS=b, GOLD=g where IDVILLAGE=i;<br />
  until done end repeat;<br />
  close c;<br />
end |<br />
<br />
delimiter ;&quot;]]></description>
            <dc:creator>joel trab</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Mon, 01 Apr 2013 16:36:28 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,575135,575135#msg-575135</guid>
            <title>Unable to find my.ini file to set variable event_scheduler = on (3 replies)</title>
            <link>http://forums.mysql.com/read.php?119,575135,575135#msg-575135</link>
            <description><![CDATA[ I'm using windows Os, mysql - v5.1.66.<br />
The event scheduler does not seem to work after an restart of MYSQL server, After reading lot many posts, i learnt setting event_scheduler variable in my.ini file resolves the problem but, i searched a lot for the file in my system without any success. <br />
Somebody help me please]]></description>
            <dc:creator>Preethi K</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Thu, 13 Dec 2012 13:23:37 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,573855,573855#msg-573855</guid>
            <title>EVENT with specific requirement (1 reply)</title>
            <link>http://forums.mysql.com/read.php?119,573855,573855#msg-573855</link>
            <description><![CDATA[ Hello everybody<br />
<br />
I want to apply an daily csv data import with an EVENT.<br />
Don't know if my requirement work in general.<br />
I get a csv file at a not consistent time, so the EVENT should start when the file is available.<br />
Is it possible to create a statement for this issue?<br />
Thanks]]></description>
            <dc:creator>Robert Hilsenbeck</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Wed, 05 Dec 2012 07:52:43 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,573071,573071#msg-573071</guid>
            <title>Prepared Statement inside a Scheduled Event? (1 reply)</title>
            <link>http://forums.mysql.com/read.php?119,573071,573071#msg-573071</link>
            <description><![CDATA[ Is there a limitation with using Prepared Statements inside a [scheduled] event.<br />
<br />
I am trying to create an event that will rename a table at the start of each month, so it changes from 'tablename' to 'tablename_yyyymm' (e.g. tablename_201210). I have all the code, and on it's own it works fine, but when I test it in the Scheduled Event it seems to stop at 'EXECUTE stmt;'<br />
<br />
My code is:<br />
DELIMITER //<br />
CREATE EVENT IF NOT EXISTS tableName_change<br />
ON SCHEDULE<br />
EVERY 1 MONTH STARTS '2012-12-01 00:00:00'<br />
ON COMPLETION PRESERVE<br />
COMMENT ''<br />
  DO<br />
  BEGIN<br />
<br />
#Stop Replication<br />
    STOP SLAVE;<br />
<br />
#If Month=Jan Use Last Year<br />
    SET @YearToUse = (<br />
      SELECT<br />
        CASE<br />
          WHEN MID(NOW(),6,2) = 1 THEN LEFT(NOW(),4)-1<br />
          ELSE LEFT(NOW(),4)<br />
          END AS YearToUse<br />
      );<br />
<br />
#If Month=Jan Set Month to 12<br />
    SET @MonthToUse = (<br />
      SELECT<br />
        CASE<br />
          WHEN MID(NOW(),6,2) = 1 THEN 12<br />
          ELSE MID(NOW(),6,2)-1<br />
          END AS MonthToUse<br />
      );<br />
<br />
#Name of new Table<br />
    SET @NewName = CONCAT('tablename_',@YearToUse,@MonthToUse);<br />
<br />
#Rename Table to table_YYYYMM<br />
    SET @SQL = (CONCAT('RENAME TABLE tableName TO ',@NewName));<br />
    PREPARE stmt FROM @SQL;<br />
    EXECUTE stmt;<br />
    DEALLOCATE PREPARE stmt;<br />
<br />
#Create blank table<br />
    SET @SQL = (CONCAT('CREATE TABLE tablename LIKE ',@NewName));<br />
    PREPARE stmt FROM @SQL;<br />
    EXECUTE stmt;<br />
    DEALLOCATE PREPARE stmt;<br />
<br />
#Restart Replication<br />
    START SLAVE;<br />
<br />
  END //<br />
DELIMITER;]]></description>
            <dc:creator>Ian Gates</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Wed, 07 Nov 2012 08:47:26 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,571534,571534#msg-571534</guid>
            <title>EVENT not running HELP (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,571534,571534#msg-571534</link>
            <description><![CDATA[ I have used an event with event_scheduler many times not problem.....has been deactivated a while.....I now try start it and nothing is happening! Could be I have a new server version since I last tested it.<br />
<br />
Server 5.5.28<br />
<br />
<br />
<br />
set global event_scheduler=1;<br />
<br />
DELIMITER $$<br />
<br />
USE `ddd`$$<br />
CREATE EVENT logging <br />
ON SCHEDULE <br />
EVERY 1 SECOND <br />
STARTS (NOW() + INTERVAL 1 SECOND) -- enter sampling period here<br />
DO <br />
BEGIN<br />
<br />
-- start streamers 1-24 <br />
INSERT INTO `ddd`.`log_streamer_01` (streamer_tension, cable_speed, reel_speed_rpm, meter_out, synchro_delta_deviation, time)<br />
SELECT streamer_tension, cable_speed, reel_speed_rpm, meter_out, synchro_delta_deviation, NOW() <br />
FROM `ddd`.`b04_reel_data` WHERE id=1;]]></description>
            <dc:creator>Darren White</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Fri, 19 Oct 2012 11:02:43 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,568736,568736#msg-568736</guid>
            <title>Use Event Mysql (1 reply)</title>
            <link>http://forums.mysql.com/read.php?119,568736,568736#msg-568736</link>
            <description><![CDATA[ Hi everybody  !!!<br />
I was trying to create a mysql event.<br />
I use <b>XAMPP</b> and <b>phpMyAdmin</b>.<br />
I created a simple event:<br />
-----------<br />
<b>DELIMITER ;;<br />
CREATE EVENT INCREASE <br />
 ON SCHEDULE EVERY 1 MINUTE<br />
 DO<br />
 BEGIN<br />
  UPDATE `translation` SET `probability` = `probability`+1;<br />
 END;;<br />
DELIMITER ;</b><br />
-----------<br />
<br />
After I created I tried to see the table &quot;<b>information_schema</b>&quot;.<br />
The event was created correctely, but after 5 minutes nothing happens.<br />
Infact the <b>`EVENTS`.LAST_EXECUTED</b> field was remained NULL.<br />
<br />
I tried also to change the function with this difference:<br />
&quot;<b>ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MINUTE</b>&quot;.<br />
Nothing.<br />
<br />
<b>How can I make to work my event?<br />
What did I wrong?</b><br />
<br />
Thanks you ;)]]></description>
            <dc:creator>Draxent Seventh</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Tue, 23 Oct 2012 06:35:54 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,565767,565767#msg-565767</guid>
            <title>How to stop replicating events? (2 replies)</title>
            <link>http://forums.mysql.com/read.php?119,565767,565767#msg-565767</link>
            <description><![CDATA[ Hello!<br />
<br />
We had a problem where our slave attempted to replicate a &quot;DROP EVENT&quot; statement from our master, but the event did not exist on the slave and so an error occured, causing replication to halt.<br />
<br />
The event didn't exist on our slave because while the event was running on the master, the slave (after processing the initial &quot;CREATE EVENT&quot; statement) was rebooted and &quot;forgot&quot; about the event. When the master finished its event, the slave received the &quot;DROP EVENT&quot; statement and threw an error.<br />
<br />
I had to then pick through the binlogs to find the position of this statement and skip it which took some time.<br />
<br />
We don't actually need to run the event on the master, and would prefer if we could prevent the replication of the EVENT statements altogether. Is there any way to do this? We've used a wildcard prefix for tables which works ok for that, but I can't see a way to do this for EVENTs?<br />
<br />
There is another thread that asked this question but it appears to be closed:<br />
<br />
<a href="http://forums.mysql.com/read.php?119,241951,241951#msg-241951"  rel="nofollow">http://forums.mysql.com/read.php?119,241951,241951#msg-241951</a><br />
<br />
**EDIT**<br />
<br />
Been digging around in the options and I still can't find anything that helps. A workaround would be to have the event scheduler use &quot;DROP IF EXISTS&quot; when purging the events on mysql shutdown. At least then only a warning would be generated and replication would not halt.<br />
<br />
Is there any way to override the event scheduler purge process so it doesn't try to do a &quot;DROP EVENT&quot;?<br />
<br />
Cheers,<br />
Adam.]]></description>
            <dc:creator>Adam Newman</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Thu, 04 Oct 2012 15:01:20 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,561854,561854#msg-561854</guid>
            <title>scheduled task doesn't work on 5.524-log/windows (1 reply)</title>
            <link>http://forums.mysql.com/read.php?119,561854,561854#msg-561854</link>
            <description><![CDATA[ Hello!<br />
<br />
I'm running mysql-5.5.24-log on windows.<br />
<br />
the following statement creates scheduled event, but I see no evidence of its work<br />
<br />
use mysql;<br />
delimiter \\<br />
create event if not exists disable_innodb_flush<br />
  on schedule every 1 minute<br />
  starts current_timestamp<br />
  do<br />
  begin <br />
   insert into t (t) values (current_timestamp);<br />
   set global innodb_flush_log_at_trx_commit = 2;<br />
  end <br />
  <br />
<br />
what could be wrong ?]]></description>
            <dc:creator>Ilya Shipitsin</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Wed, 18 Jul 2012 21:43:30 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,560640,560640#msg-560640</guid>
            <title>scheduled batch command (1 reply)</title>
            <link>http://forums.mysql.com/read.php?119,560640,560640#msg-560640</link>
            <description><![CDATA[ I'm trying to run a scheduled batch command of the form:<br />
<br />
mysql&gt; create event e_test on schedule every 1 day do source /var/www/home/test.sql;<br />
<br />
This gives me: <br />
<br />
ERROR 1064 (42000): You have an error in your SQL syntax .. <br />
<br />
while <br />
<br />
mysql&gt; source /var/www/home/test.sql;<br />
<br />
works perfectly fine. <br />
<br />
I tried running with '\. /var/www/home/test.sql' instead of 'source /var/www/home/test.sql' but that gives me: <br />
<br />
Failed to open file '/var/www/home/test.sql;', error: 2<br />
<br />
Any ideas would be appreciated.<br />
<br />
(running mysql 5.1.49-3 (Debian) )]]></description>
            <dc:creator>Anthony Thomas</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Tue, 10 Jul 2012 17:24:27 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,559184,559184#msg-559184</guid>
            <title>Using the MySQL event scheduler to rotate the slow query log (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,559184,559184#msg-559184</link>
            <description><![CDATA[ Using the MySQL event scheduler to rotate the slow query log<br />
<a href="http://swanhart.livejournal.com/135348.html"  rel="nofollow">http://swanhart.livejournal.com/135348.html</a>]]></description>
            <dc:creator>Edwin Desouza</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Thu, 28 Jun 2012 18:51:01 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,556995,556995#msg-556995</guid>
            <title>Strange event behavior (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,556995,556995#msg-556995</link>
            <description><![CDATA[ Good morning everyone! I'm having a strange behavior for the query you find at the bottom. <br />
<br />
As you can see, I use the IF in the select and it properly works. It writes 'No travel' when the date is '1899', otherwise it writes the normal date.<br />
<br />
if I execute the INSERT/SELECT statement by myself, it works perfectly. However, if I use the create event (the one at the bottom), the event is properly executed, but the IF part has a strange behavior, and it reports almost always 'No travel'.<br />
<br />
This is so strange, please help me!<br />
<br />
Lookin' forward<br />
<br />
<br />
Aldo<br />
<br />
 <br />
<br />
CREATE EVENT AggiornamentoFmsOdierno<br />
    ON SCHEDULE EVERY 1 DAY STARTS '2012-06-08 03:00:00'<br />
    DO<br />
INSERT INTO fms_vehicle_day_sum_fercam (F, Plate, GroupId, Day, `First Start`, `Last Stop`, `Km Start`, `Km Stop`, `Total Cons Start`, `Total Cons Stop`, `Dist Diff`, `Cons Total`, `Cons Drive`, `Cons Stand`)<br />
SELECT<br />
  vehicles.Code,<br />
  vehicles.Name AS Plate,<br />
  vehicles.GroupId AS GroupId,<br />
  fms_vehicle_day_sum.Day,<br />
  IF(fms_vehicle_day_sum.FirstStart = '1899-12-30 00:00:00','No Travel',fms_vehicle_day_sum.FirstStart) `First Start`,<br />
  IF(fms_vehicle_day_sum.LastStop = '1899-12-30 00:00:00','No Travel',fms_vehicle_day_sum.LastStop) `Last Stop`,<br />
  fms_vehicle_day_sum.Km_Start AS `Km Start`,<br />
  fms_vehicle_day_sum.Km_Stop AS `Km Stop`,<br />
  fms_vehicle_day_sum.FMS_TotalConsStart AS `Total Cons Start`,<br />
  fms_vehicle_day_sum.FMS_TotalConsStop AS `Total Cons Stop`,<br />
  fms_vehicle_day_sum.DistDiff AS `Dist Diff`,<br />
  fms_vehicle_day_sum.ConsTotal AS `Cons Total`,<br />
  fms_vehicle_day_sum.ConsDrive AS `Cons Drive`,<br />
  fms_vehicle_day_sum.ConsStand AS `Cons Stand`<br />
FROM fms_vehicle_day_sum<br />
LEFT JOIN vehicles ON vehicles.id=fms_vehicle_day_sum.VehicleId<br />
WHERE (fms_vehicle_day_sum.Day = SUBDATE(CURDATE(), 1)) AND (vehicles.code LIKE 'F%')<br />
ORDER BY vehicles.Code;]]></description>
            <dc:creator>Aldo Doronzo</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Mon, 11 Jun 2012 09:07:34 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,549889,549889#msg-549889</guid>
            <title>Event ERROR (2 replies)</title>
            <link>http://forums.mysql.com/read.php?119,549889,549889#msg-549889</link>
            <description><![CDATA[ CREATE EVENT e_vicidial_auto_calls <br />
ON SCHEDULE <br />
EVERY 55 SECOND <br />
COMMENT 'Clears out sessions table' <br />
DO <br />
DELETE FROM vicidial_auto_calls where channel IS NULL<br />
<br />
<br />
Above event creations gives me an Error and I cant add the event.. Pl advice.]]></description>
            <dc:creator>David parker</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Thu, 07 Jun 2012 06:33:18 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,531954,531954#msg-531954</guid>
            <title>How to obtain the list of stored procedure parameters?? (1 reply)</title>
            <link>http://forums.mysql.com/read.php?119,531954,531954#msg-531954</link>
            <description><![CDATA[ In java program, how to obtain  mysql stored procedure parameter list??<br />
As in SqlServer, you can call sp_sproc_columns to obtain the parameters columns of a stored procedure.in mysql,How to do it? <br />
Any help is appreciated！<br />
<br />
duanxz<br />
Regards！]]></description>
            <dc:creator>duan xz</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Thu, 10 May 2012 07:48:15 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,531952,531952#msg-531952</guid>
            <title>How to obtain the list of stored procedure parameters?? (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,531952,531952#msg-531952</link>
            <description><![CDATA[ In java program, how to obtain  mysql stored procedure parameter list??<br />
<br />
As in SqlServer, you can call sp_sproc_columns to obtain the parameters columns of a stored procedure.in mysql,How to do it? <br />
<br />
Any help is appreciated！<br />
<br />
<br />
<br />
duanxz<br />
Regards！]]></description>
            <dc:creator>duan xz</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Mon, 07 May 2012 09:33:05 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,526768,526768#msg-526768</guid>
            <title>Can an event run again if it is already running? (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,526768,526768#msg-526768</link>
            <description><![CDATA[ I have started working with events and until now they have all been daily clean-up events that don't take long to run.<br />
<br />
I have an idea for a new event that I want to run every 10 minutes (or so). But the catch is, in some cases (not often) the run time on the event can take well over 10 minutes and it has a high processor load.<br />
<br />
If I schedule this event to run every 10 minutes (for example) and it is alreay running, will I end up with two copies of the event running and hammer my processor? or will the scheduler see that the event is still running from the last time and skip execution?<br />
<br />
If it will just fire off another copy of the event, how can I prevent this?]]></description>
            <dc:creator>Glenn Schworak</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Sat, 21 Apr 2012 22:00:06 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,526110,526110#msg-526110</guid>
            <title>What is wrong with this EVENT? (1 reply)</title>
            <link>http://forums.mysql.com/read.php?119,526110,526110#msg-526110</link>
            <description><![CDATA[ Hello, im fairly new to MySql and im playing around with events :D<br />
Im having a spot of bother with one im wondering if anyone can point out to me why its not working correctly or at least not the way i expect.<br />
<br />
CREATE EVENT newQueue1 <br />
ON SCHEDULE EVERY 30 SECOND <br />
DO <br />
BEGIN <br />
DECLARE amount integer; <br />
SET amount = (SELECT amount FROM queue WHERE id=1); <br />
IF amount &lt;= 0 THEN <br />
//Do something else <br />
ELSE <br />
UPDATE queue SET amount=amount-1, total_production_time=total_production_time-30 WHERE id=1; <br />
END IF; <br />
END;<br />
<br />
What the above is currently doing is take the amount from 200 to 0 on the first pass when it should take really 1 of every 30 seconds.<br />
<br />
What have i done wrong? Any help would be greatly appreciated.<br />
<br />
Many thanks in advance]]></description>
            <dc:creator>Russell Brown</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Sat, 28 Apr 2012 09:35:20 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,524935,524935#msg-524935</guid>
            <title>mysql Event running yearly calculations (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,524935,524935#msg-524935</link>
            <description><![CDATA[ I have the following code<br />
<br />
CREATE EVENT myevent2<br />
ON SCHEDULE EVERY '1' YEAR<br />
STARTS commit_date + INTERVAL 1 YEAR<br />
DO<br />
UPDATE lms.loan <br />
<br />
<br />
<br />
        if new.app_loan_type='Computer Loan' then <br />
    SET NEW.app_yearly_intrst = (NEW.app_ln_amnt *(NEW.computer_interest/100));<br />
    end if;<br />
<br />
<br />
    if new.app_loan_type=&quot;Miscellaneous Loan&quot; then <br />
    SET NEW.app_yearly_intrst = (NEW.app_ln_amnt *(NEW.miscellaneous_interest/100));<br />
    end if;<br />
<br />
    if new.app_loan_type=&quot;Motor Vehicle Loan&quot; then <br />
    SET NEW.app_yearly_intrst = (NEW.app_ln_amnt *(NEW.motor_vehicle_interest/100));<br />
    end if;<br />
<br />
    if new.app_loan_type=&quot;Motor Vehicle Insurance Loan&quot; then <br />
    SET NEW.app_yearly_intrst = (NEW.app_ln_amnt *(NEW.mv_insurance_interest/100));<br />
    end if;<br />
<br />
    if new.app_loan_type=&quot;Motor Vehicle Repair Loan&quot; then <br />
    SET NEW.app_yearly_intrst = (NEW.app_ln_amnt *(NEW.mv_repair_interest/100));<br />
    end if;<br />
<br />
<br />
    if new.app_loan_type=&quot;Salary Advance Loan&quot; then <br />
    SET NEW.app_yearly_intrst = (NEW.app_ln_amnt *(NEW.salary_advance_interest/100));<br />
    end if;<br />
<br />
<br />
    if new.app_loan_type=&quot;Tertiary Loan&quot; then <br />
    SET NEW.app_yearly_intrst = (NEW.app_ln_amnt *(NEW.tertiary_interest/100));<br />
    end if;<br />
<br />
    SET NEW.app_mnthly_intrest = (NEW.app_yearly_intrst/12);<br />
    SET NEW.app_quarterly_intrest = (NEW.app_mnthly_intrest * 3);<br />
    SET NEW.app_amnt_owed = (NEW.app_ln_amnt+ NEW.app_yearly_intrst);<br />
<br />
  END$$<br />
I am trying to create an event to calculate interest for two loan types: 'Computer Loan' and 'Miscellaneous Loan'.. etc, on a Yearly basis, however the yearly basis is dependent on the the commit_date column that would be a year from the commit_date column, then if the app_loan_type is 'Computer Loan'or 'miscellaneous Loan' then the yearly interest is calculated Im also calculating monthly interest, Quarterly Interest and total amount owed, but my main problem is how to set the interval of commit_date and current date to be 1 year]]></description>
            <dc:creator>Damian Hynes</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Tue, 10 Apr 2012 13:31:38 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,518928,518928#msg-518928</guid>
            <title>event to export table to csv log file every day at midnight (3 replies)</title>
            <link>http://forums.mysql.com/read.php?119,518928,518928#msg-518928</link>
            <description><![CDATA[ ok I have no experience of Events or the Mysql command line (I've used workbench).<br />
<br />
I have some log tables being generated using triggers.<br />
<br />
Now I want to export these tables to a csv files and empty these tables once a day.<br />
<br />
I have some code for generating the log files which works:<br />
<br />
SELECT @myCommand := concat(<br />
&quot;SELECT * into OUTFILE 'C:/logs/log_01_&quot;, <br />
DATE_FORMAT(now(),'%Y_%m_%d_%h_%i_%s'), &quot;.csv'<br />
FIELDS TERMINATED BY ';' <br />
LINES TERMINATED BY '\n' <br />
FROM log_streamer_01&quot;);<br />
PREPARE stmt FROM @myCommand;<br />
EXECUTE stmt;<br />
<br />
now I want to have a schedule that executes this every day at 00:00:00 and then empties the table (ready to be filled again over the next day).<br />
<br />
I would really appreciate some help to get me started quickly here. :-)]]></description>
            <dc:creator>Darren White</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Wed, 07 Mar 2012 17:02:51 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,516043,516043#msg-516043</guid>
            <title>Help getting event to work (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,516043,516043#msg-516043</link>
            <description><![CDATA[ Hi all,<br />
<br />
I am trying to create an event which deletes items in a cart more than 1 hour old, and at the same time updates to other tables. - I can see that the event is running, but nothing is being executed, can someone point out what is wrong?<br />
<br />
Are the variables being declared wrongly perhaps?<br />
<br />
DELIMITER | <br />
CREATE <br />
EVENT delete_cart <br />
ON SCHEDULE EVERY 5 MINUTE<br />
DO <br />
BEGIN<br />
<br />
DECLARE cartID INTEGER(11);<br />
DECLARE cartProductID INTEGER (11);<br />
DECLARE cartAntal INTEGER (11);<br />
DECLARE cartStr VARCHAR(5);<br />
<br />
SELECT id, produkt_id, antal, str INTO cartID, cartProductID, cartAntal, cartStr FROM cart WHERE added_date &gt;= added_date + 10000 LIMIT 1 ;<br />
<br />
UPDATE products SET stock = stock + cartAntal WHERE produkt_id = cartProductID;<br />
<br />
UPDATE sizes SET antal = antal + cartAntal WHERE size = cartStr AND product_id = cartProductID;<br />
<br />
DELETE FROM cart WHERE id = cartID;<br />
<br />
END | <br />
DELIMITER ;<br />
<br />
Unfortunately nothing happens at all :-/<br />
<br />
I hope somone can see what is wrong here!<br />
Regards Jan Klemmensen]]></description>
            <dc:creator>Jan Klemmensen</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Sat, 18 Feb 2012 17:52:29 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,495951,495951#msg-495951</guid>
            <title>Schedule an event for N Wednesdays in a month for N years (1 reply)</title>
            <link>http://forums.mysql.com/read.php?119,495951,495951#msg-495951</link>
            <description><![CDATA[ Hi all,<br />
<br />
I need an event that will call N stored procedures on a specific Wednesdays in a month at a specific time (say; 7am) for N years.<br />
<br />
example, the event should kick on the following Wednesdays: <br />
<br />
9/11/2011<br />
23/11/2011<br />
7/12/2011<br />
21/12/2011<br />
4/01/2012<br />
18/01/2012<br />
1/02/2012<br />
15/02/2012<br />
29/02/2012<br />
<br />
...basically it should follow this sequence; 1 Wednesday YES, 1 Wednesday NO; 1 Wednesday YES, 1 Wednesday NO; 1 Wednesday YES, 1 Wednesday NO....<br />
<br />
<br />
Your help is highly appreciated.<br />
<br />
Thanks]]></description>
            <dc:creator>My SQL</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Mon, 05 Dec 2011 16:41:50 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,432131,432131#msg-432131</guid>
            <title>Event for each selected row (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,432131,432131#msg-432131</link>
            <description><![CDATA[ Hi there, I want to create an event scheduler in mysql, but I dont have the required experience to do that.<br />
<br />
I have a table named villages and a table named build.<br />
The event must select every seconds the rows from build that have end_time = UNIX_TIMESTAMP(NOW()) and for each selected row it should proceed as it follows:<br />
<br />
set @level = select this.building from villages where id = this.village;<br />
update villages set this.building = @level + 1 where id = this.villages;<br />
delete from build where id = this.id<br />
<br />
by this.id / this.building I mean the id and the building column data from the actual row.]]></description>
            <dc:creator>Duluman Eduard</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Sun, 28 Aug 2011 16:47:50 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,429393,429393#msg-429393</guid>
            <title>Finding/killing long running InnoDB transactions with Events (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,429393,429393#msg-429393</link>
            <description><![CDATA[ Finding/killing long running InnoDB transactions with Events<br />
<a href="http://www.markleith.co.uk/?p=730"  rel="nofollow">http://www.markleith.co.uk/?p=730</a><br />
<br />
Using the event scheduler to purge the process list <br />
<a href="http://datacharmer.blogspot.com/2008/10/using-event-scheduler-to-purge-process.html"  rel="nofollow">http://datacharmer.blogspot.com/2008/10/using-event-scheduler-to-purge-process.html</a><br />
<br />
`kill_run_aways` Stored Proc<br />
<a href="http://forge.mysql.com/tools/tool.php?id=106"  rel="nofollow">http://forge.mysql.com/tools/tool.php?id=106</a><br />
<br />
Yoshinori: Tracking long running transactions in MySQL <br />
<a href="http://yoshinorimatsunobu.blogspot.com/2011/04/tracking-long-running-transactions-in.html"  rel="nofollow">http://yoshinorimatsunobu.blogspot.com/2011/04/tracking-long-running-transactions-in.html</a><br />
<br />
MySQL Utilities: mysqlprocgrep<br />
<a href="http://wb.mysql.com/utilities/man/mysqlprocgrep.html"  rel="nofollow">http://wb.mysql.com/utilities/man/mysqlprocgrep.html</a><br />
<br />
How to debug long-running transactions in MySQL<br />
<a href="http://www.mysqlperformanceblog.com/2011/03/08/how-to-debug-long-running-transactions-in-mysql/"  rel="nofollow">http://www.mysqlperformanceblog.com/2011/03/08/how-to-debug-long-running-transactions-in-mysql/</a>]]></description>
            <dc:creator>Edwin DeSouza</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Thu, 04 Aug 2011 15:09:36 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,427017,427017#msg-427017</guid>
            <title>Access remotely to events (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,427017,427017#msg-427017</link>
            <description><![CDATA[ Hi<br />
I handling my DB remotely. Like creating and modifying stored procedures and functions. <br />
But when i want to create new events remotely. Mysql throw following error:<br />
“     Access denied for user 'root'@'%' to database 'myDB'    ”<br />
May anyone help me ?<br />
<br />
Best.<br />
Morteza]]></description>
            <dc:creator>morteza ir</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Fri, 15 Jul 2011 14:33:27 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,426989,426989#msg-426989</guid>
            <title>How to tell what happened to my event? (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,426989,426989#msg-426989</link>
            <description><![CDATA[ Hello,<br />
I have created a simple event that supposed to run every morning at 2am. the event will call a SP that copies a table to hist and purges old records from the orig, see below. The 'Show events' command demonstrates that the event is registered. The SP works, it has been tested many times. This morning I do not find a history tabl ewith this mornings 2am timestamp, indicating the event is not working. <br />
<br />
How can I tell what happened to the event, if anything?<br />
Thanks!<br />
<br />
drop event if exists cleanRev_cdmrpUpdates;<br />
delimiter |<br />
-- <a href="http://mysqlresources.com/documentation/stored-routines/148"  rel="nofollow">http://mysqlresources.com/documentation/stored-routines/148</a>  <br />
CREATE EVENT cleanRev_cdmrpUpdates<br />
 ON SCHEDULE EVERY 1 day<br />
STARTS '2011-07-14 02:00:00'<br />
ON COMPLETION PRESERVE<br />
COMMENT 'Daily backup and purge of rev_cdmrp.updates table'<br />
do call sp_cleanRev_cdmrpUpdates();<br />
   <br />
   <br />
   <br />
delimiter ;]]></description>
            <dc:creator>Pieter Huiberts</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Fri, 15 Jul 2011 12:40:00 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,424568,424568#msg-424568</guid>
            <title>Repeat Event daily at particular time (1 reply)</title>
            <link>http://forums.mysql.com/read.php?119,424568,424568#msg-424568</link>
            <description><![CDATA[ hi<br />
i need to run a event in mysql which should execute script everyday @00:01:00 repeatly...<br />
<br />
Pls help me to create this event scheduler in mysql]]></description>
            <dc:creator>Amuthasakaran Bala Subramanian</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Fri, 01 Jul 2011 07:23:09 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,423046,423046#msg-423046</guid>
            <title>Highlights of Lucene Revolution 2011--Now in Slides (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,423046,423046#msg-423046</link>
            <description><![CDATA[ Lucid Imagination founder Marc Krellenstein kicked off the Lucene Revolution yesterday with a keynote address covering the history of search. Here are the slides, followed by some highlights. <a href="http://bit.ly/m8lnK1"  rel="nofollow">http://bit.ly/m8lnK1</a>]]></description>
            <dc:creator>sandra willson</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Fri, 10 Jun 2011 07:34:22 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,421984,421984#msg-421984</guid>
            <title>modify the schedule of an event without use the Alter command (1 reply)</title>
            <link>http://forums.mysql.com/read.php?119,421984,421984#msg-421984</link>
            <description><![CDATA[ is there a way to modify the schedule of an event without use the Alter command?<br />
<br />
maybe updating the table information_schema.events? <br />
<br />
Thank you in advance]]></description>
            <dc:creator>Jorge Jaen</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Wed, 01 Jun 2011 07:05:50 +0000</pubDate>
        </item>
        <item>
            <guid>http://forums.mysql.com/read.php?119,421943,421943#msg-421943</guid>
            <title>Find/Kill long running InnoDB transactions with Events (no replies)</title>
            <link>http://forums.mysql.com/read.php?119,421943,421943#msg-421943</link>
            <description><![CDATA[ Find/Kill long running InnoDB transactions with Events<br />
<a href="http://www.markleith.co.uk/?p=730"  rel="nofollow">http://www.markleith.co.uk/?p=730</a>]]></description>
            <dc:creator>Edwin DeSouza</dc:creator>
            <category>Events (Job Scheduler)</category>
            <pubDate>Tue, 31 May 2011 15:18:37 +0000</pubDate>
        </item>
    </channel>
</rss>
