Pergunta

I have the following data in a Physical file:

   KFIELD     KVALUE

   C18R01     ABCD
   C18R01     ABCD
   C18R02     ABCD
   C18R02     ABCD
   C18R03     ABCD
    .
    .
   C18R39     ABCD

I would now like to have the KFIELD column updated to C38R01,C38R01, C38R02 and so on

I am using DB2 or SQL over iSeries, please help in updating the same

Foi útil?

Solução

Try to use REPLACE function as below

update physical
set KFIELD = REPLACE(KFIELD,'C18R', 'C38R')

Outras dicas

Here is a simple update statement using replace():

update Physical
    set kfield = replace(kfield, 'C18R', 'C38R')
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top