从SQL SERVER里读一个字段的值(字符型),读到变量 ls_myvar 中,如果字符里含有单引号,想删除它,怎样做?
百度谷歌了一天也没找到,谢谢,请不要随便说几句敷谴我
------解决方案--------------------
select replace('asdf"asdf','"','') into :ls_myvar from aaa
------解决方案--------------------
- SQL code
declare @r varchar(20)set @r = '''a''bc'''select @r, replace(@r, '''', '')
------解决方案--------------------
------解决方案--------------------
long ll_pos
ll_pos = pos(ls_myvar, "'")
while ll_pos > 0
ls_myvar = replace(ls_myvar, ll_pos, 1, "")
ll_pos = pos(ls_myvar, "'")
loop