MySQL Forums
Forum List  »  Triggers

Variable unusable
Posted by: Robby ROUDON
Date: October 13, 2015 11:08AM

Hi all,
I want to create a trigger which call a procedure. This procedure need 2 parameters, the new value inserted:

CREATE TRIGGER default_value_page
AFTER INSERT
ON page
FOR EACH ROW
BEGIN
add_default_content(NEW.id, NEW.modele);
END;

I have this error :
#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 '(NEW.id, NEW.modele)' at line 6

And since 2 days I'm looking for a solution...

The header of my procedure :
CREATE PROCEDURE add_default_content (IN idPage INT, IN idModele INT)

And my table :
CREATE TABLE modele_page (
id int(2) UNIQUE AUTO_INCREMENT,
nom varchar(50) NOT NULL,
description text(200),
PRIMARY KEY (id)
);

Thank you for anyone who try to help me :)
I'm using MySQL 5.6

Options: ReplyQuote


Subject
Views
Written By
Posted
Variable unusable
1748
October 13, 2015 11:08AM
886
October 13, 2015 12:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.