Skip to Main Content

Oracle Database Discussions

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!

Difference between varchar2(10) and varchar2(10 char)

LauryMar 19 2015 — edited Mar 24 2015

Hi,

I have a query that joins table TAB_A colomn COLA (type -> number) with TAB_B column COLB (type -> varchar2(10)).

To avoid:
ERROR at line 1:
ORA-01722: invalid number

I need to do:
cast(TAB_A.COLA as varchar2(10 char)) = cast(TAB_B.COLB as varchar2(10 char))

and then it works...

But I don't have this problem when for TAB_B I have column COLB (type -> varchar2(10 char)).

Can someone explain me the difference between varchar2(10 char) and varchar2(10)?

Thanks by advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2015
Added on Mar 19 2015
6 comments
1,791 views