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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

special charactors in data column 2

Status
Not open for further replies.

lovekang

Programmer
Feb 16, 2006
86
KR
oracle 9i and my_col data type is varchar2

select my_col from my_tbl; ---> results in john
select length(my_col) from my_tbl; ---> results in 7 not 4. I think there are special charactors or control charactors at the end.
select '['||my_col||']' from my_tbl; ---> results in [john not [john]
select replace(my_col, ' ', 'x') from my_tbl; ---> implies not space

the my_col column is inserted by a java class and its data is from httpsession
the data in the httpsession is from sap.

what's happening?
 
lovekang,

if you
Code:
select length(trim(my_col))
then it will remove white spaces and should result in 4 and not 7.

If the characters are something different, then you could
Code:
select ascii(substr(my_col,5,1))
will return the ascii value of the fifth character.

Let us know if this helps

Regards

T

Grinding away at things Oracular
 
Lovekang,

Let's take a step back and have you confirm what you want:

1) Are you simply curious as to what is causing the lengths of my_col to be greater than the visible characters?

2) Are you wanting to identify the ASCII values for the "invisible" characters?

3) Do you want a function that strips any special characters from my_col? Do you the stripping to be from the front, back, and middle of my_col?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top