Similar question, but for Oracle.
Why would I not always want to choose VARCHAR(MAX)?
Similar question, but for Oracle.
Why would I not always want to choose VARCHAR(MAX)?
Probably because Oracle
does not support VARCHAR(MAX)
.
VARCHAR
should not be used in Oracle
at all.
As for now, it's a synonym for VARCHAR2
, but it may change in future so that it will distinguish between an empty string and a NULL
.
VARCHAR
is supposed to do it but doesn't in current versions of Oracle
, and hence should not be used.
In Oracle
, maximum length for a VARCHAR2
is 4000
in SQL
and 32767
in PL/SQL
.
For larger values, you should use CLOB
, but it's very different from a VARCHAR2
. You should use special methods to access it, etc.
Because it doesn't work in Oracle! You could declare all columns as VARCHAR2(4000) if you wanted, but it isn't recommended by any means. There will be no difference in storage or performance of the database, but: