gpt4 book ai didi

string - 转义postgresql中的所有单引号

转载 作者:行者123 更新时间:2023-11-29 11:55:04 25 4
gpt4 key购买 nike

不是转义文本中的每个 ',有没有办法一次性转义它们,像这样:

insert into table1(data) values(@'it's a string, it's got some single quotes')

最佳答案

insert into table1(data) values
($$it's a string, it's got some single quotes$$)

Dollar quoting

A dollar-quoted string constant consists of a dollar sign ($), an optional "tag" of zero or more characters, another dollar sign, an arbitrary sequence of characters that makes up the string content, a dollar sign, the same tag that began this dollar quote, and a dollar sign

关于string - 转义postgresql中的所有单引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39107715/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com