'DROP' table inside trigger - MySQL
<p>I have a table 'chat_record' which has a column 'chat_id'. For each 'chat_id' there exists table of same name. Now i Want to create a trigger to drop the table whenever an entry from chat_record is deleted.
Here is my code -
**</p>

<pre><code>create trigger drop_table before delete on chat_record
for each row
begin
declare chatid varchar(20);
set @chatid=(select chat_id from chat_record where chat_id=old.chat_id);
drop table chatid;
end;
</code></pre>

<p>**
Error 1422 : Explicit or implicit commit is not allowed is stored function or trigger.</p>