I am trying to use the following stored procedure.
DELIMITER $$
CREATE DEFINER=`root`@`localhost`
PROCEDURE `DeleteField`( IN _TABLENAME Text, IN _FIELDNAME text)
BEGIN
if exists (select * from information_schema.Columns
where table_name = _TABLENAME and column_name = _FIELDNAME)
then
alter table _TABLENAME drop column _FIELDNAME;
end if;
END
So, I call ("anytable", "Anyfield") and I get an error message Error code: 1146Table'Database._tablename'doesn't exist This _tablename should be my parameter, not a string.
I need help before I hang myself, I love my life too much.
source
share