Rassac
asked on
Space inserted when Incrementing a number
Hi I am trying to update a field which has a fomat of '00000'.
When I update using this code:
a.version = TO_CHAR( a.version + 1, '00000')
I am getting for instance ' 00001'. Please note the space before the zeros.
Any help please?
Thanks.
When I update using this code:
a.version = TO_CHAR( a.version + 1, '00000')
I am getting for instance ' 00001'. Please note the space before the zeros.
Any help please?
Thanks.
- check the actual value of a.version what is its exact length or data type?
ASKER
It's varchar2(10)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So how would you go around it? Is it necessary to use the trim or maybe some other code could be used?
thanks.
thanks.
the code you used just about sums it up.
ASKER
a.version = Trim(TO_CHAR( a.version + 1, '00000'))
Is there any explanation for this, why is a space being inserted?
Thanks.