SQL-J Language Reference,
Page 91 of 118


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

BIT VARYING

The BIT VARYING field allows you to store bit strings of a specified length. Like the BIT data type, it is useful for unstructured data where character strings are not appropriate (e.g., images).

Syntax for Column Definition

BIT VARYING (length)

length is an unsigned integer literal designating the length in bits.

Unlike the case for the BIT data type, there is no default length for a BIT VARYING type.

Corresponding Compile-Time Java Type


byte[]

JDBC Metadata Type (java.sql.Types)


BINARY

BIT VARYING stores variable-length bit strings. Unlike BIT values, BIT VARYING values are not padded out to the target length. If a BIT VARYING value is larger than the target length, a bit right truncation exception is raised.

Comparisons of BIT and BIT VARYING values are precise. For two bit strings to be equal, they must be exactly the same length. (This differs from the way some other DBMSs handle BINARY values but works as specified in SQL-92.)

An operation on a BIT VARYING and a BIT value (e.g., a concatenation) yields a BIT VARYING value.

Literal Examples

The type of a bit literal is always a BIT, not a BIT VARYING.

Implementation-Defined Aspects

The only limit on the length of BIT and BIT VARYING data types is the constraint of the integer used to specify the length, the value java.lang.Integer.MAX_VALUE.

[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.