來人啊,救我啊,弄一天了,連的是sql server
select id,command,description,content from message where 1=1and command=#{command}我連接的是sql server,條件必須加單引號比如:select *from user where name=‘張三’ 我想問問在message.xml中的兩個單引號怎么寫? 寫成這樣保錯and command='#{command}'錯誤說索引1超出范圍
select id,command,description,content from message where 1=1and command=#{command}我連接的是sql server,條件必須加單引號比如:select *from user where name=‘張三’ 我想問問在message.xml中的兩個單引號怎么寫? 寫成這樣保錯and command='#{command}'錯誤說索引1超出范圍
舉報
2016-08-04
不需要加單引號。。。and command = #{command} 就可以了
2016-06-15
在xml文件中使用特殊字符需要轉義,轉義字符必須以&開始,以;結束,單引號的轉義寫法為&apos。如果不想寫轉義,也可以用cdata屬性,這個自己查吧。