View previous topic :: View next topic
|
Author |
Message |
jaspal
New User
Joined: 22 May 2007 Posts: 68 Location: mumbai
|
|
|
|
Hi ,
i want to update one column of length 8 bytes wherein first 2 bytes is having different values.
i want to update the table column such that first 2 bytes are replaced by 47.
Ex:
Code: |
TABLE CURRENT VALUE :
SEQ NUMBER
62354
23445
23325
25232
23234
REQUIRED VALUE :
47354
47445
47325
47232
47234 |
Thanks in advance.
Jaspal |
|
Back to top |
|
|
anandinmainframe
Active User
Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
Hi Jaspal,
Update
Set SUBSTR(CHAR(SEQ NUMBER),1,2) = 47
will do it for you i think |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what is the datatype of 'SEQ NUMBER' (which is not a valid db2 column name) |
|
Back to top |
|
|
jaspal
New User
Joined: 22 May 2007 Posts: 68 Location: mumbai
|
|
|
|
Hi dbzTHEdinosauer,
Actual field name is I_Account and is Numeric.
Thanks,
Jaspal |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
numeric is not a db2 datatype - integer, etc are numeric datatypes.
the casting for the substr depends on knowing the exact datatype of the column. |
|
Back to top |
|
|
|