2011-09-27 110 views

回答

1

它實際上不像我寫的那樣工作。 我只是這樣的代碼:

set @preparedstmt = concat('SELECT tid, LENGTH(message) len FROM ? where tid=? and first=1'); 
prepare stmt from prepared_stmt; 
execute stmt using v_tid; 
drop prepare stmt; 

只是照顧表名的,它不應該與placeholder.So取代@preparedstmt應與Concat的方法生成發表聲明,這是剛剛更換在帶有佔位符的條件中的參數,而不是表名。

+0

表名「FROM?」而其他標識符不能在USING子句中定義。 – Devart

相關問題