Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Finding hidden characters

ramya_162Oct 24 2017 — edited Oct 24 2017

Hi Experts,

Could you please help me to find hidden characters.

custno is VARCHAR2 in both the tables (customer & address).

select custno from customer where custno='445578';--Getting data.

SELECT length(custno),length(TRIM(custno)) from customer where custno='445578'; --O/P 8,8 same length

SELECT length(custno),length(TRIM(custno)) from address where custno='445578' --O/P 8,8 same length

select c.* from customer c,address a where c.custno=a.custno and c.custno='445578'  --No Result

If I use it in join no result is coming without TRIM on custno of customer table.

select c.* from customer c,address a where TRIM(c.custno)=a.custno and c.custno='445578'  --Getting Result

I am unable to find what is happening.

Could you please help me.

Thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2017
Added on Oct 24 2017
13 comments
1,950 views