Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: varchar2(10) vs. varchar2(10 BYTE)
Guyon Morée wrote:
> Hi all,
>
>
> When I generate table scripts with TOAD, the script declares the
> varchar2 column size with: varchar2(10 byte) instead of varchar2(10).
> The latter is what I'm used to.
>
> Also this script won't run on every (version of the?) database.
>
> Can someone tell me the difference between the 2?
>
>
> thanks
>
> Guyon Morée
>
BYTE would be the default; the other possibility is CHAR.
So, technically, there is no difference between the two (BYTE
being default), the difference is in the CHAR option: a character
can take more that one byte (up to 3 byte, iirc). Think multibyte
character sets.
This option tells a multibyte database (!) to use character semantics
when storing data: a varchar2(10) would be able to store 10 characters,
in stead of 10 byte worth of characters.
BTW - you can tell TOAD to suppress this...
-- Regards, Frank van BortelReceived on Mon Oct 11 2004 - 05:18:46 CDT