Ask the Expert

What is the VARCHAR2 datatype?

May I please have a description of the VARCHAR2 datatype? This datatype is used in our catalogue database and I cannot find an explanation that will provide a clear understanding.

    Requires Free Membership to View

The VARCHAR2 datatype is used to hold character data, including numbers. This datatype is "variable" in the sense that it will not allocate space for unused characters. For instance, if you define your column as VARCHAR2(30), it can hold up to 30 characters. If you are using a single-byte character set, those 30 characters can require 30 bytes of storage space. If you store a five-letter word in that column, the VARCHAR2 datatype does not require all 30 bytes to be allocated. Rather, it only needs the space to store that five-letter word, or five bytes in a single-byte character set.

A complete description of all datatypes can be found in the Oracle documentation.

This was first published in November 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: