List:General Discussion« Previous MessageNext Message »
From:Jigal van Hemert Date:June 30 2005 2:27pm
Subject:Re: drop trigger?
View as plain text  
From: "Patrik Wallstrom"
> Using 5.0.7-beta the "drop trigger" functions in a very mysterious
> way:
>
> mysql> use testdb;
> mysql> drop trigger foo;
> ERROR 1064 (42000): 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 1

MySQL is correct here: the syntax is
    drop trigger <tablename>.<triggername>;
http://dev.mysql.com/doc/mysql/en/drop-trigger.html

> mysql> drop trigger testdb.foo;
> ERROR 1146 (42S02): Table 'testdb.testdb' doesn't exist

It seems to me that the table testdb doesn't exist (anymore).
Was the trigger 'foo' created for table 'testdb'? Trigger are associated
with tables, not databases (yet).
http://dev.mysql.com/doc/mysql/en/create-trigger.html

If you previously created the trigger for table 'bar', the command should
read:
    drop trigger `bar`.`foo`;

Regards, Jigal.

Thread
drop trigger?Patrik Wallstrom30 Jun
  • Re: drop trigger?Jeff Smelser30 Jun
  • Re: drop trigger?Jigal van Hemert30 Jun
    • Re: drop trigger?Patrik Wallstrom30 Jun
  • Re: drop trigger?Gleb Paharenko30 Jun