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!

casting CHAR to VARCHAR2

431158Jun 27 2005 — edited Jun 27 2005
Is it possible to type cast a CHAR variable to VARCHAR2 in Oracle 9i ?

var varchar2(20);
var1 char(20);
begin
var := cast(trim(var1) as varchar2);
end;

It says "expression is of wrong type"

Throw some light on this. Oracle 9i document says that the CASTing from char,varchar2 to char,varchar2 is allowed.

Thanks,
Sam
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 25 2005
Added on Jun 27 2005
1 comment
4,922 views