我有以下文字:
Price is .....
return policy is....
Mega's accept....
我想将整个文本插入类型的列 TEXT
我写的是:
Insert into A (id,msg) values (5, ' Price is .....
return policy is....
Mega's store online ....')
Mega's
是商店的名称。在'
此名称中导致查询认为它是文本的结尾...
所以我收到错误消息:
错误:“价格为.....”列不存在
我试图用SELECT插入,但这也不起作用。我收到相同的错误消息。
如何执行此插入?
如果您不想(或无法)更改实际文本,请使用美元引号。只需将第一个和最后一个替换为'
例如$$
:
Insert into A (id,msg) values (5, $$ Price is .....
return policy is....
Mega's store online ....$$)
您需要使用实际文本中没有出现的定界符。如果您的文字可以包含$$
,则可以使用其他内容,例如:$not_there$
Insert into A (id,msg) values (5, $not_there$ Price is .....
return policy is....
Mega's store online ....$not_there$)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句