Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sybase replace function

Tags:

sybase

sap-ase

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'.

like image 998
user841293 Avatar asked Feb 13 '15 18:02

user841293


1 Answers

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.

like image 54
RobV Avatar answered Jan 01 '23 13:01

RobV