Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

13.5.4.5. SHOW CREATE EVENT

SHOW CREATE EVENT event_name

This statement displays the CREATE TABLE statement needed to re-create a given event. For example (using the same event e_daily defined and then altered in Section 13.5.4.13, “SHOW EVENTS):

mysql> SHOW CREATE EVENT test.e_daily\G

*************************** 1. row ***************************
       Event: e_daily
Create Event: CREATE EVENT e_daily
                ON SCHEDULE EVERY 1 DAY
                STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR
                ENABLE
                COMMENT 'Saves total number of sessions and
                         clears the table once per day.'
                DO
                  BEGIN
                    INSERT INTO site_activity.totals (when, total)
                      SELECT CURRENT_TIMESTAMP, COUNT(*) 
                      FROM site_activity.sessions;
                    DELETE FROM site_activity.sessions;
                  END

Note that the output reflects the current status of the event (ENABLE) rather than the status with which it was created.

This statement was implemented in MySQL 5.1.6.


 
 
  Published under the terms of the GNU General Public License Design by Interspire