Domanda

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

È stato utile?

Soluzione

Try to use REPLACE function as below

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

Altri suggerimenti

Here is a simple update statement using replace():

update Physical
    set kfield = replace(kfield, 'C18R', 'C38R')
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top