RE: Column width different in view

From: Mark W. Farnham <>
Date: Sat, 16 Jul 2011 12:19:33 -0400
Message-ID: <027c01cc43d4$26a72e00$73f58a00$>

Very likely that is it. Graham Wood clued me in to using the cast operator to get the result you want, but understand that the default the database chooses is going to be safe for the possible content under conversion rules (notice that 18*3 is 54, which also happens to be 6*9 and the answer to everything once you realize that the famous 42 is base thirteen.) But I digress. If you were going potentially from a single byte character encoding to a possibly 3 byte encoding per character, then the database is protecting you in this view creation. Perhaps the one database where you experience this problem is single byte character encoding like ASCII7 and the others are not. If you know that trouble can’t happen in your context then casting it back to 18 should not be a problem.  


SQL> desc dual

Name                                                                          Null?    Type

----------------------------------------------------------------------------- -------- -------------

SQL> create view vdual as (select cast(dummy as varchar2(1)) smartie from dual);  

View created.  

SQL> desc vdual

Name                                                                          Null?    Type

----------------------------------------------------------------------------- -------- -------------

SQL> select * from vdual;  




From: [] On Behalf Of Bobak, Mark Sent: Friday, July 15, 2011 6:09 PM
To: Dennis Williams; Subject: Re: Column width different in view  

What is nls length semantics set to? What is character set?

Sent from my Motorola ATRIX™ 4G on AT&T

-----Original message-----

From: Dennis Williams <> To: "" <> Sent: Fri, Jul 15, 2011 22:04:24 GMT+00:00 Subject: Column width different in view


We have a situation where a view is created on a table. The underlying column is defined as CHAR(18). We are doing this to a number of Oracle databases. On all of them the view creates just fine. But on one database the column in the view is created as CHAR(54). Has anyone encountered anything like this?  

Thank you,

Dennis Williams

-- Received on Sat Jul 16 2011 - 11:19:33 CDT

Original text of this message