Re: Changing two letters in a column, is there an easier SQL way?
Posted in 1995
In article <3p0f42$dkb@miso.wwa.com>, pinoy_ako <john@miso.wwa.com> wrote:
>> We have Informix SE and 4gl version 6.00. We have the following table
...
>> gear char(30)
...
>> We have to change two letters in the gear field specifically the
>> letters "SB" to "SD". The problem is that the position of the
>> letters are different. These are some of the possible formats:
i would use a 4gl cursor to find the rows, and update the rows individually.
>> As you can see, the "SB" is at different positions. So is there a
>> way to do this using SQL? (dbaccess) Pls. post or email. Thanks!
there is a huge brute-force way, but it would be ugly:
update table set gear[1,2]="SD" where gear[1,2]="SB";
update table set gear[2,3]="SD" where gear[2,3]="SB";...