我正在將數據加載到存儲過程中的一個表中,該存儲過程的文件名作爲參數傳遞。無法使用加載數據infile識別錯誤的原因
select @load_config:= concat('load data local infile ',config_file,' into table config fields terminated by \',\' lines terminated by \n');
prepare stm from @load_config;
爲了這個,我正在一個錯誤
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '/mnt/appln/mysql/dvdbuser/config.csv into table config fields terminated by ',' ' at line 1 i tried this as well
select @load_config:= concat('load data local infile \'',config_file,'\' into table config fields terminated by \',\' lines terminated by \n');
prepare stm from @load_config;
爲此,我得到了錯誤
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
說實話我失去了,我不知道在哪裏我搞砸了
是的,我確實遇到過這個問題,我想通過文件作爲參數看起來像我現在無法做到這一點不管怎麼說不錯的答案 – avz2611