1.0

Table Of Contents
VARCHAR
Provides for variable-length strings with a maximum limit for length. If a string value is longer than the maximum
length, then any trailing blanks are trimmed to make the length same as the maximum length, while an exception
is raised if characters other than spaces are required to be truncated. When mixing CHARs and VARCHARs in
expressions, the shorter value is padded with spaces to the length of longer string.
The type of a string constant is CHAR, not VARCHAR. To represent a single quotation mark within a string,
use two quotation marks:
VALUES 'going to Chandra''s place'
The length of VARCHAR is an unsigned integer constant.
java.lang.StringEquivalent Java type
32672Maximum length
java.sql.Types.VARCHARJDBC metadata type
ResultSet.getString, PreparedStatement.setStringJDBC methods
System.StringEquivalent .NET type
Vmware.Data.SQLFire.SQLFType.VarCharADO.NET metadata type
StringADO.NET mapped System.Data.Dbtype
DbDataReader.GetStringADO.NET getter
Syntax in CREATE TABLE
{ VARCHAR | CHAR VARYING | CHARACTER VARYING }(length)
VARCHAR FOR BIT DATA
Provides for variable-length byte strings with a maximum limit for length. This is used when character types are
not appropriate due to unstructured data or otherwise. No padding is performed for comparisons between CHAR
FOR BIT DATA and VARCHAR FOR BIT DATA types as per SQL-92 standard (this is different from the way
some DBMSs behave). An operation involving a VARCHAR FOR BIT DATA and CHAR FOR BIT DATA
yields a value of type VARCHAR FOR BIT DATA.
The type of a byte literal is always a VARCHAR FOR BIT DATA, not a CHAR FOR BIT DATA.
The length is an unsigned integer constant for the length of value in bytes.
use byte[] or java.io.InputStream / java.lang.OutputStream as requiredEquivalent Java type
32672 bytesMaximum length
java.sql.Types.VARBINARYJDBC metadata type
ResultSet.getBytes, PreparedStatement.setBytesJDBC methods
use byte[] where requiredEquivalent .NET type
Vmware.Data.SQLFire.SQLFType.VarBinaryADO.NET metadata type
BinaryADO.NET mapped System.Data.Dbtype
DbDataReader.GetBytesADO.NET getter
583
SQL Language Reference