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 entire field

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 '% ';

eqvn_name is varchar

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
 
A SELECT will not change the data - it just changes how it is presented as a result of the query. The data in the table is not changed. If you are trying to get the trailing spaces out of your data, try
Code:
UPDATE eqvn SET eqvn_name = TRIM(eqvn_name);
COMMIT;
 
I just realised it and finished the job. So dumb of me.

Thanks anyways :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top