Describes Domain type information for a column in a table.
public Domain
This interface contains constants to denote the various domains, and methods to extract information from a Domain object.
The following example demonstrates how to create a schema for a simple database. The T2 table is created with an integer column and a variable length character string column that is, at most, 32 bytes long.
// Assumes a valid Connection object conn TableSchema table_schema; IndexSchema index_schema; table_schema = conn.createTable("T2"); table_schema.createColumn("num", Domain.INTEGER); table_schema.createColumn("name", Domain.VARCHAR, 32); index_schema = table_schema.createPrimaryIndex("primary"); index_schema.addColumn("num", IndexSchema.ASCENDING); |
Domain Constant | SQL Type | Value Range |
---|---|---|
BIT | BIT | 0 or 1 |
TINY | TINYINT | 0 to 255 (unsigned integer using 1 byte of storage) |
SHORT | SMALLINT | -32768 to 32767 (signed integer using 2 bytes of storage) |
UNSIGNED_SHORT | UNSIGNED SMALLINT | 0 to 65535 (unsigned integer using 2 bytes of storage) |
INTEGER | INTEGER | -231 to 231 - 1, or -2147483648 to 2147483647 (signed integer using 4 bytes of storage) |
UNSIGNED_INTEGER | UNSIGNED INTEGER | 0 to 232 - 1, or 0 to 4294967295 (unsigned integer using 4 bytes of storage) |
BIG | BIGINT | -263 to 263 - 1, or -9223372036854775808 to 9223372036854775807 (signed integer using 8 bytes of storage) |
UNSIGNED_BIG | UNSIGNED BIGINT | 0 to 264 - 1, or 0 to 18446744073709551615 (unsigned integer using 8 bytes of storage) |
Domain Constant | SQL Type | Value Range |
---|---|---|
REAL | REAL | -3.402823e+38 to 3.402823e+38, with numbers close to zero as small as 1.175495e-38 (single precision floating point number using 4 bytes of storage, rounding errors may occur after the sixth digit) |
DOUBLE | DOUBLE | -1.79769313486231e+308 to 1.79769313486231e+308, with numbers close to zero as small as 2.22507385850721e-308 (single precision floating point number using 8 bytes of storage, rounding errors may occur after the fifteenth digit) |
NUMERIC | NUMERIC (precision, scale) | any decimal numbers with precision (size) total digits and with scale digits after the decimal point (no rounding within precision) |
Domain Constant | SQL Type | Size Range |
---|---|---|
VARCHAR | VARCHAR(size) | 1 to 32767 characters (stored as 1-3 byte UTF-8 characters). When evaluating expressions, the maximum length for a temporary character value is 2048 characters. |
LONGVARCHAR | LONG VARCHAR | Any length (memory permitting). The only operations allowed on LONG VARCHAR columns are to insert, update, or delete them, or to include them in the select-list of a query. |
BINARY | BINARY(size) | 1 to 32767 bytes. When evaluating expressions, the maximum length for a temporary character value is 2048 bytes. |
LONGBINARY | LONG BINARY | Any length (memory permitting). The only operations allowed on LONG BINARY columns are to insert, update, or delete them, or to include them in the select-list of a query. |
UUID | UNIQUEIDENTIFIER | Always 16 bytes binary with special interpretation |
Domain Constant | SQL Type | Value |
---|---|---|
DATE | DATE | Year, month, day. |
TIME | TIME | Hour, minute, second, and fraction of a second. |
TIMESTAMP | TIMESTAMP | DATE and TIME. |
BIT columns are not nullable by default. All other types are nullable by default.
All members of Domain, including all inherited members.
BIG variable
BINARY variable
BINARY_DEFAULT variable
BINARY_MAX variable
BINARY_MIN variable
BIT variable
CHARACTER_MAX variable
DATE variable
DOMAIN_MAX variable
DOUBLE variable
INTEGER variable
LONGBINARY variable
LONGBINARY_DEFAULT variable
LONGBINARY_MIN variable
LONGVARCHAR variable
LONGVARCHAR_DEFAULT variable
LONGVARCHAR_MIN variable
NUMERIC variable
PRECISION_DEFAULT variable
PRECISION_MAX variable
PRECISION_MIN variable
REAL variable
SCALE_DEFAULT variable
SCALE_MAX variable
SCALE_MIN variable
SHORT variable
TIME variable
TIMESTAMP variable
TINY variable
UINT16_MAX variable
UNSIGNED_BIG variable
UNSIGNED_INTEGER variable
UNSIGNED_SHORT variable
UUID variable
VARCHAR variable
VARCHAR_DEFAULT variable
VARCHAR_MIN variable
getName method
getPrecision method
getScale method
getSize method
getType method
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |