How datatype Char is usefull over VarChar !!

oracle India
  • 14 years ago

    Hi,

    can someone tell me how datatype Char is useful than VarChar? And when to use Char?

    Thanks

    amolt.Confused [*-)]

  • 14 years ago

    Hi amolt

    The char is a fixed-length character data type, the varchar is a variable-length character data type.

    Because char is a fixed-length data type, the storage size of the char value is equal to the maximum size for this column. Because varchar is a variable-length data type, the storage size of the varchar value is the actual length of the data entered, not the maximum size for this column.

    You can use char when the data entries in a column are expected to be the same size.
    You can use varchar when the data entries in a column are expected to vary considerably in size




    Regards

    DoctorMahdi

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Java is to JavaScript what Car is to Carpet.” - Chris Heilmann