Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Number formats
You could try the following:
select substr('0000'||field_name,length('0000'||field_name)-3,4)
from table_name
where clause:
This will produce 4 digit numbers preceded by zeros.
Pilsbury wrote:
Hi people,Received on Tue Feb 02 1999 - 09:50:32 CSTCan anyone tell me how to pad a field which is declared as an integer (or
number(38)) with zeros please? The field is always 4 digits but cannot be
declared as CHAR as the Pro*C code I've got doesn't handle this. Each time
I input 0005 for example, it is converted to 5 which is no good. Any
suggestions would be greatly appreciated.TIA
Pilsbury
![]() |
![]() |