Hi,
Can anybody tell me equivalent command in Sybase for the following command in Oracle ?
Select replace(‘abc|ert|rfrfrf|’,’|’,’;’) from dual ;
Thanks in Advance
Printable View
Hi,
Can anybody tell me equivalent command in Sybase for the following command in Oracle ?
Select replace(‘abc|ert|rfrfrf|’,’|’,’;’) from dual ;
Thanks in Advance
I haven't worked in oracle. I presume you want to replace all | with ;. Sybase doesnt have a replace cmd. you have to use a combo of charindex and stuff to replace it.
you could have the following to replace ur string.
declare @my_var char(25)
select @my_var = 'abc|ert|rfrfrf|'
while charindex('|', @my_var) > 0
begin
select @my_var = stuff(@my_var, charindex('|', @my_var), 1, ';')
end
select @my_var