Home » RDBMS Server » Server Administration » truncating integers
truncating integers [message #374972] Mon, 16 July 2001 08:08 Go to next message
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 #374973 is a reply to message #374972] Mon, 16 July 2001 08:39 Go to previous messageGo to next message
sandeep
Messages: 110
Registered: October 2000
Senior Member
did u try rtrim ?? i am a learner so i am not sure if it would definately work.
Re: truncating integers [message #374988 is a reply to message #374972] Tue, 17 July 2001 09:14 Go to previous messageGo to next message
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 Go to previous message
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
Previous Topic: Difference betn. SQL & SQL *Plus
Next Topic: sql error message
Goto Forum:
  


Current Time: Sun Jul 07 16:44:09 CDT 2024