Previous Page TOC Index Next Page

APPENDIX C DATA TYPES


The following abbreviations used in the following tables:

Abbreviation

Description

DEFLEN

the defined length of the column;
e.g. for CHAR(24) the precision and length is 24

DEFPREC

the defined precision;
e.g. for NUMERIC(10,3) it is 10

DEFSCALE

the defined scale;
e.g. for NUMERIC(10,3), it is 3

MAXLEN

the maximum length of column

N/A

not applicable

Character Data Types

Data type

Size

Precision

Scale

Length

Display size

CHAR

2 G*

DEFLEN

N/A

DEFLEN

DEFLEN

VARCHAR

2 G**

DEFLEN

N/A

DEFLEN

DEFLEN

LONG VARCHAR

2 G

MAXLEN

N/A

MAXLEN

MAXLEN

* default is 1
** default is 254

Numeric Data Types

Data type

Range

Precision

Scale

Length

Display size

DECIMAL

±3.6e16

16

DEFSCALE

18

18

NUMERIC

±3.6e16

DEFPREC

DEFSCALE

DEFPREC
+2

DEFPREC
+ 2

TINYINT

[-128, 127]
[0, 255]

3

0

1 (bytes)

4 (signed)
3 (unsigned)

SMALLINT

[-32768, 32767]
[0, 65535]

5

0

2 (bytes)

6 (signed)
5 (unsigned)

INTEGER

[-231, 231-1]
[0, 232-1]

10

0

4 (bytes)

11 (signed)
10 (unsigned)

REAL

±1.7014117
e38

7

N/A

4 (bytes)

13

FLOAT

±8.9884657
e307

15

N/A

8 (bytes)

22

DOUBLE PRECISION

±8.9884657
e307

15

N/A

8 (bytes)

22

Binary Data Types

Data type

Size

Precision

Scale

Length

Display size

BINARY

2 G*

DEFLEN

N/A

DEFLEN

DEFLEN x 2

VARBINARY

2 G**

DEFLEN

N/A

DEFLEN

DEFLEN x 2

LONG VARBINARY

2 G

MAXLEN

N/A

MAXLEN

MAXLEN x 2

* default is 1
** default is 254

Date Data Type

Data type

Range

Precision

Scale

Length

Display size

DATE

N/A

10*

N/A

6**

10*

* the number of characters in the yyyy-mm-dd format
** the size of the DATE_STRUCT structure

Time Data Type

Data type

Range

Precision

Scale

Length

Display size

TIME

N/A

8*

N/A

6**

8*

* the number of characters in the hh:mm:ss format
** the size of the TIME_STRUCT structure

Timestamp Data Type

Data type

Range

Precision

Scale

Length

Display size

TIMESTAMP

N/A

19*

9

16**

19/29***

* the number of characters in the 'yyyy-mm-dd hh:mm:ss.fffffffff' format
** the size of the TIMESTAMP_STRUCT structure
*** size is 29 with a decimal fraction part

The Smallest Possible Non-zero Numbers

Data type

Value

DOUBLE

2.2250738585072014e-308

REAL

1.175494351e-38

Description of Different Column Values in the Tables

The range of a numeric column refers to the minimum and maximum values the column can store. The size of character columns refers to the maximum length of data that can be stored in the column of that data type.

The precision of a numeric column refers to the maximum number of digits used by the data type of the column. The precision of a non-numeric column refers to the defined length of the column.

The scale of a numeric column refers to the maximum number of digits to the right of the decimal point. Note that for the approximate floating point number columns, the scale is undefined, since the number of digits to the right of the decimal point is not fixed.

The length of a column is the maximum number of bytes returned to the application when data is transferred to its default C type. For character data, the length does not include the null termination byte. Note that the length of a column may differ from the number of bytes needed to store the data on the data source.

The display size of a column is the maximum number of bytes needed to display data in character form.

Previous Page TOC Index Next Page

Copyright © 1992-1997 Solid Information Technology Ltd All rights reserved.