我正在尝试这个,但是会抛出错误
DELIMITER $$
CREATE PROCEDURE usp_dynamicExc1 (Tablename varchar(100)
,Columnname varchar(100),
Data varchar(100) )
BEGIN
SET @Tablename = Tablename;
SET @columnname = Columnname;
SET @value1 = Data;
SET @q= CONCAT('Insert into ',@tablename,' (',@columnname,') values (',@value1,')');
PREPARE stmt FROM @q;
EXECUTE stmt ; DEALLOCATE PREPARE stmt;
END
我收到此错误
10:30:16 PREPARE stmt FROM @q Error Code: 1064. 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 0.000 sec