Menu

#2418 (ok 2.11) Trouble to CREATE TRIGGER with delimiter

2.9.2
fixed
1
2013-06-11
2007-04-20
HEMM
No

I can't create trigger in compound statement whe use phpmyadmin but use comman line prompt I don't have trouble.

Code to create trigger
delimiter //

CREATE TRIGGER Capital_bu

BEFORE UPDATE

ON Capital

FOR EACH ROW

BEGIN

SET @country = OLD.Country;

SET @capital_old = OLD.Capital;

SET @capital_new = NEW.Capital;

END;

//
delimiter;
----------------------------------------------
ERROR
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unknown Punctuation String @ 11
STR: //
SQL: delimiter //

CREATE TRIGGER Capital_bu2

BEFORE UPDATE

ON Capital

FOR EACH ROW

BEGIN

SET @country = OLD.Country;

SQL query:

delimiter // CREATE TRIGGER Capital_bu2 BEFORE UPDATE ON Capital FOR EACH ROW BEGIN SET @country = OLD.Country;

MySQL said: Documentation
#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 'delimiter //

CREATE TRIGGER Capital_bu2

BEFORE UPDATE

-----------------------------------
IN COMMAND PRONT LIN NO PROBLE IS ALL OK

Discussion

  • Marc Delisle

    Marc Delisle - 2007-04-21
    • priority: 5 --> 1
    • assigned_to: nobody --> lem9
    • summary: Trouble to CREATE TRIGGER with delimiter --> (ok 2.11) Trouble to CREATE TRIGGER with delimiter
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2007-08-21
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.