truncating integers [message #374972] |
Mon, 16 July 2001 08:08 |
Jennifer
Messages: 20 Registered: September 1999
|
Junior Member |
|
|
Greetings :)
Would you happen to know how I could remove the blank spaces from an integer field? For instance, when I select a value from the field, I get "977124 ". Substring doesn't seem to like doing it though..
Thanks.
|
|
|
|
Re: truncating integers [message #374988 is a reply to message #374972] |
Tue, 17 July 2001 09:14 |
kavithask
Messages: 34 Registered: March 2001 Location: London
|
Member |
|
|
Hi,
LTRIM and RTRIM functions do trim of the trailing blanks from a field. Added to that, if there are trailing blanks, and if you use TO_NUMBER function, the TO_NUMBER function trims off the trailing blanks automatically.
But if there is a space in between, then you would need the Replace command.
SELECT REPLACE(' 97 7124 ', ' ') from dual;
Cheers,
Kavitha
|
|
|
Re: truncating integers [message #374989 is a reply to message #374972] |
Tue, 17 July 2001 09:14 |
kavithask
Messages: 34 Registered: March 2001 Location: London
|
Member |
|
|
Hi,
LTRIM and RTRIM functions do trim of the trailing blanks from a field. Added to that, if there are trailing blanks, and if you use TO_NUMBER function, the TO_NUMBER function trims off the trailing blanks automatically.
But if there is a space in between, then you would need the Replace command.
SELECT REPLACE(' 97 7124 ', ' ') from dual;
Cheers,
Kavitha
|
|
|