Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TRIM trailing spaces of a field 1

Status
Not open for further replies.

selavarti

Programmer
Feb 24, 2004
33
0
0
US
Hello,

I have to trim trailing spaces on a feild on both sides.

I did


select TRIM(eqvn_name) as eqvn_name from eqvn where eqvn_name like '% ';

I feel this is right. But after running TRIM function when I query to check if there are any with trailing spaces. It is returning same set of results. Am I doing something wrong?

Thank you
 
then they are not spaces...they might other characters like chr(10) or Chr(13)

do this to find out...

SELECT ASCII(yourfield) from yourtable...

then do a replace() function to remove them

-DNG
 
Lemme guess: column is of type char, not varchar?

And TRIM() is not SQL Server function. LTRIM() and RTRIM() together do the same thing though.

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
I am using SQL Navigator, but the database is in Orcale :)

I am looking at the options you guys gave..thank you
 
Better to check in the Oracle forum, this is for MS sql server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top