-
I am trying to add a zero "0" to the front of my data
and am having trouble accomplishing this
I am trying to make the column look like this;
BEFORE AFTER
DEED DEED
122899 122899
122899 122899
20785 020785
61695 061695
61695 061695
42087 042087
111194 111194
I tried using the LPAD function to no avail
can anybody help me?
scotta
J.Scott Adams
-
If the column is of NUMBER type then the "0" preceeding 0s are truncated.
Check to make sure that the column type is not of NUMBER
Sam
Thanx
Sam
Life is a journey, not a destination!
-
sorry I forgot to add this
It is a varchar2 datatype
J.Scott Adams
-
Here is an example:
SQL>create table data(num VARCHAR2(10));
SQL>insert into data values (LPAD('1029',10,'0'));
SQL>select * from data;
NUM
==========
0000001029
SQL>insert into data values ('384');
SQL> update data
2 set num = LPAD(num,10,'0')
3 where num = '384';
1 row updated.
SQL> select * from data;
NUM
==========
0000001029
0000000384
Hope this would clear your doubts. For detail check your LPAD syntax.
Sam
Thanx
Sam
Life is a journey, not a destination!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|