Drop table from procedure
Posted by:
Jiri
Date: February 01, 2006 04:11AM
Hi,
I can't drop table from procedure. Can anybody help me?
The problem is in this procedure:
create procedure deletelayer(IN idl int)
BEGIN
DECLARE tabnam varchar(50);
SELECT attribute_table INTO tabnam FROM JanLayer WHERE idLayer=idl; /*read the name of the table to delete */
DROP TABLE IF EXISTS tabnam; /* delete table - name of the table is stored in variable tabnam*/
DELETE FROM JanLayer WHERE idLayer=idl;
END//
Wha it doesn't work?
The MySQL try to drop table 'tabnam', which ofcourse doesn't exist. Why doesn't MySQL work with tabnam as variable?
The version of MySQL is 5.0.17.
Thank you for advice
JR
Subject
Views
Written By
Posted
Drop table from procedure
5132
February 01, 2006 04:11AM
2240
February 01, 2006 04:36AM
1958
February 01, 2006 05:33AM
2113
February 01, 2006 05:47AM
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.