Q

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.

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

Dig deeper on Oracle database design and architecture

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

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:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close