• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 776
  • Last Modified:

trim in Oracle is not working

Hey,

I tried to trim the value from one field from table A;

select fieldA, dump(fieldA) from table A;

V004888,Typ=1 Len=11: 32,32,32,86,48,48,52,56,56,56,32

How can i retrieve fieldA without special character?

Thanks
0
idmdeveloper
Asked:
idmdeveloper
  • 2
1 Solution
 
sdstuberCommented:
if fieldA is of type CHAR,  it will always be right-padded with spaces.


however,  this should yield what you are looking for

select trim(fielda) from tableA;
0
 
sdstuberCommented:
yes, I just tried it....

---- without trim

SELECT fielda, DUMP(fielda) FROM tablea;

FIELDA     DUMP(FIELDA)                               
---------- -------------------------------------------
   V04888  Typ=1 Len=10: 32,32,32,86,48,52,56,56,56,32
1 row selected.

Open in new window


with trim

SELECT trim(fielda), DUMP(trim(fielda))  FROM tablea;

TRIM(FIELDA) DUMP(TRIM(FIELDA))            
------------ ------------------------------
V04888       Typ=1 Len=6: 86,48,52,56,56,56
1 row selected.

Open in new window


if these aren't your results, please post sample data and expected output.
0
 
jrb1Commented:
Anything else on this issue?
0
 
idmdeveloperAuthor Commented:
Thanks a lot
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now