user841293
user841293

Reputation: 77

Sybase replace function

I am unable to use sybase replace function to replace data. Basically what i need is to update all the occurrences of 'abc' and change with 'zzz'.] table_clmn is data type text I am using the following sql --

update  table
set table_clmn = replace(table_clmn , 'abc', 'zzz') WHere id in (1, 2)

I get the following error

Incorrect syntax near the keyword 'replace'.

Upvotes: 7

Views: 19213

Answers (1)

RobV
RobV

Reputation: 2378

Assuming you're using Sybase ASE, you need to use the built-in function 'str_replace()' instead of 'replace()'. The 'replace' function can only be used for changing the default constraint on a table column.

Upvotes: 9

Related Questions