Table of ContentsPreviousNext

Ispirer
Please, note, that Ispirer SQLWays 6.0 is no longer supported and provided to clients.
You can try out automated conversion of databases and applications with Ispirer Toolkit for free. Download free trial.
Check out the relevant toolkit documentation.


Ispirer SQLWays Database Migration Software

CHAR, NCHAR and VARCHAR

[NATIONAL]CHAR[(n)] [BINARY]

A fixed-length character data. The range of n is 0 to 255 characters (1 to 255 prior to MySQL Version 3.23). When n is not specified the default value is 1.

When CHAR values are stored, they are right-padded with spaces to the specified length. When CHAR values are retrieved, trailing spaces are removed. BINARY keyword is given to sort and compare CHAR values in case-sensitive manner. NATIONAL CHAR (or NCHAR) is used to define that a CHAR column should use the default CHARACTER set. This is the default in MySQL.

If the column is defined as CHAR(0) and nullable then the column will occupy only one bit and can take two values: NULL or "" (empty string).

[NATIONAL] VARCHAR(n) [BINARY]

A variable-length string. The range of n is 0 to 255 characters (1 to 255 prior to MySQL Version 4.0.2). Value is stored in database using only as many characters as it contains, plus one byte to record the length.

When the value is stored trailing spaces are removed.

BINARY keyword is given to sort and compare VARCHAR values in case-sensitive manner.


Table of ContentsPreviousNext
Copyright 1999-2023 Ispirer Systems.
Ispirer and SQLWays are registered trademarks. All other product names may be trademarks of the respective companies.
All rights reserved.