开发者

Help required in triggers

CREATE TRIGGER membership AFTER INSERT ON jos_config5 FOR EACH ROW BEGIN INSERT INTO jos_config4( identity_guid, UserID, STATU开发者_开发技巧S , original_conf_path, output_file_path, time_of_process, time_of_start, time_of_completion, status_message, Projectname ) VALUES ( '12', '345', '753', '34', '45', 'NA', 'NA', 'NA', 'User has not started processing...', 'NA')

I am using the PHPMyadmin on executing the getting error as

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 8

Regards, Hemant


You have a BEGIN with no END. Try this instead:

DELIMITER //
CREATE TRIGGER membership AFTER INSERT ON jos_config5
FOR EACH ROW
BEGIN
    INSERT INTO jos_config4 (
        identity_guid,
        UserID,
        STATUS,
        original_conf_path,
        output_file_path,
        time_of_process,
        time_of_start,
        time_of_completion,
        status_message,
        Projectname )
    VALUES (
        '12',
        '345',
        '753',
        '34',
        '45',
        'NA',
        'NA',
        'NA',
        'User has not started processing...', 'NA');
END;
//
DELIMITER ;

See here for the correct syntax:

http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜