Triggers in MySQL
eharetea

Use triggers in MySQL to have invoke callbacks for specific actions.

Use triggers in MySQL to have invoke callbacks for specific actions.

Date Created:Friday December 12th, 2008 02:52 AM
Date Modified:Friday December 12th, 2008 03:12 AM


DELIMITER //
CREATE TRIGGER folder_instances_callback
    AFTER INSERT ON files
    FOR EACH ROW
BEGIN
    DECLARE folder INT(11);

    SELECT folder_id
    INTO folder 
    FROM files
    WHERE file_id = NEW.file_id

    INSERT INTO nodes VALUES(NULLfile_idfolder);

END
//



Downloads:
Download: trigger.sql 293 B

Please login or Click Here to register for downloads
Creative Commons License
Triggers in MySQL by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com