Icon String Types

String types are used when you wish to store a character string of a fixed or variable length, including very large character strings.

TypeDescription
CHARACTER[(<Length>)]
CHAR[(<Length>)]
A string value with a fixed number of characters. If the length of the string value is not specified, then a length of 1 is used. The maximum length is 1024 characters. When assigning a value to a CHAR type value that is smaller in length than the specified length, the value being assigned will be padded with spaces to the specified length. For example, if you have a column defined as:

MyColumn CHAR(20)

If you were to assign the value 'Test' to the column, then the MyColumn column would contain the value 'Test'+<16 Spaces> after the assignment.
CHARACTER VARYING(<Length>)
VARCHAR(<Length>)
A string value with a variable number of characters. The length of the string value must always be specified. The maximum length is 1024 characters. Contrary to the CHARACTER type, this type does not pad the string value with spaces.
GUIDA string value that has an exact length of 38 characters. A GUID value is treated the same as a VARCHAR value.
CHARACTER LARGE OBJECT
CLOB
A large, variable-length string value with a maximum size of 2GB.

Literals
String literals use the single quote (') character to identify themselves as such. Any single quotes enclosed inside of the literal must be escaped by prefacing them with another single quote. In addition, single character constants may be specified using their literal value or by prefacing their ordinal character set position with the pound sign (#) character.

Literal Examples
-- This example specifies a VARCHAR literal

SELECT * FROM Customer WHERE Name = 'Acme Boot Makers'

-- This example specifies a VARCHAR literal with
-- embedded quotes

SELECT * FROM Customer WHERE Name = 'Bill''s Shoes'

-- This example specifies two CHAR literals (a carriage
-- return and line feed) using pound sign (#) notation

SELECT * FROM Documentation WHERE Notes LIKE '%'+#13+#10+'%'

SQL 2003 Standard Deviations
The following areas are where ElevateDB deviates from the SQL 2003 standard:

DeviationDetails
NATIONAL TypesElevateDB does not support the NATIONAL versions of the CHARACTER, CHARACTER VARYING (VARCHAR), or CHARACTER LARGE OBJECT (CLOB) types. See the Internationalization topic for more information.
CLOB TypeElevateDB does not support the specification of a default size in KB, MB, or GB for large object types.
GUID TypeElevateDB adds the GUID type as an extended type.
Image