Ask the Expert

More on VARCHAR2 versus VARCHAR

Re: Why does Oracle recommend using VARCHAR2 instead of VARCHAR datatypes?

Correct me if I'm wrong, but I believe VARCHAR is an ANSI standard datatype that allows zero length strings that are not null (which Oracle doesn't support.) If Oracle ever complies with the ANSI standard code, that specifies VARCHAR may break. The semantics of VARCHAR2 won't change in future releases, except to increase the max allowable size.

    Requires Free Membership to View

Actually, Oracle Corp. has changed the semantics of the VARCHAR2 datatype. Currently, in Oracle 9i, when you insert a zero length string into a VARCHAR2 column, Oracle treats this the same as if you insert a NULL value into that column. But it wasn't always this way. Previous versions of the database treated zero length strings and NULL values as two distinctly different items.

For More Information


This was first published in January 2003

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: