![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi People, I don't do the DDL's , am just a programmer. But i have following requirements. I have to expand a CHAR(9) field to CHAR(12) in a table. Also , i have to place 3 leading zeros to the expanded bytes. I mean if i was having '123456789' in the old field , now i have to have '000123456789' in the modified field. How can i do that? |
#3
| |||
| |||
|
|
alter table T2 alter column x set data type char(12); reorg table T2; update T2 set x = '000' || rtrim(x); [...] |
#4
| |||
| |||
|
|
On 2010-09-21 00:24, Lennart Jonsson wrote: [...] make that: alter table T2 alter column x set data type char(12); reorg table T2; update T2 set x = '000' || rtrim(x); [...] /Lennart- Hide quoted text - - Show quoted text - |
#5
| |||
| |||
|
|
Thanks Lennart I have another condition added here. Suppose i don't know how many leading zero's i need to add - it may be 3 , 4 or 5 , how can i go about that. |
![]() |
| Thread Tools | |
| Display Modes | |
| |