SQL-J Language Reference,
Page 93 of 118


[top]
[prev]
[next]
Documentation Top
Global Index
Reference Manual
TOC Index
Grammar index
Developer's Guide
TOC Index
Tuning Cloudscape
TOC Index

CHAR

CHAR provides for fixed-length storage of strings.

Syntax for Column Definition

CHAR [(length)]

length is an unsigned integer literal. The default length for a CHAR is 1.

Corresponding Compile-Time Java Type


java.lang.String

JDBC Metadata Type (java.sql.Types)


CHAR

Cloudscape inserts spaces to pad a string value shorter than the expected length. Cloudscape truncates spaces from a string value longer than the expected length. Characters other than spaces cause an exception to be raised. When binary comparison operators are applied to CHARs, the shorter string is padded with spaces to the length of the longer string.

When CHARs and VARCHARs are mixed in expressions, the shorter value is padded with spaces to the length of the longer value.

The type of a string literal is CHAR.

Implementation-Defined Aspects

The only limit on the length of CHAR data types is the value java.lang.Integer.MAX_VALUE.

Literal Examples

-- within a string literal use two single quotation marks
-- to represent a single quotation mark or apostrophe
'hello this is Joe''s string'
[top]
[prev]
[next]


Cloudscape Version 3.0
For technical support, go to: www.cloudscape.com and click Support.
Copyright © 1998 and 1999 Cloudscape, Inc. All rights reserved.