存储过程中的问题,急
delimiter //
drop procedure if exists myprocedure;
create procedure myprocedure ()
begin
declare tablesql varchar(200);
set tablesql = CONCAT ('select * from','student');
prepare statement from tablesql;
execute statement;
end
//
错在那里?
------解决方案--------------------
DELIMITER //
DROP PROCEDURE IF EXISTS myprocedure //
CREATE PROCEDURE myprocedure ()
BEGIN
SET @tablesql = CONCAT ('select * from','student');
PREPARE statement FROM @tablesql;
EXECUTE statement;
END //
DELIMITER ;
------解决方案--------------------