Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

Appendix

Data Types

Backward Compatibility

Quick Reference

 

Binary Data Types (Numbers)

Dates

Textual Data Types

National Character Data Types (UNICODE)

Data Types

 

Appendix

Overview

Omnidex supports the most common RDBMS data types, as well as some Omnidex proprietary data types for internal use and for flat file databases. These data types are used in the column definitions in the OMNIDEX environment catalog and govern how the data will be indexes and returned to an application. The data types declared in the OMNIDEX environment catalog do not affect the data type definitions in the underlying database.

Textual and binary data types are declared with a length parameter, indicating the maximum size of the data in that column. The length is passed as a parameter of the data type, enclosed in parenthesis immediately following the data type name.

datatype(length)

Several data types that have only one legal length, ORACLE DATETIME and TINYINT for example, have default lengths that are used, and therefore do not require a length parameter value.

datatype

All columns in a table, except for the last column, must have an offset of 65,535 bytes or less. This means that there may be only one data type with a length greater than 65,535 AND it must be the last column in the table definition. Therefore, there can be only one column per table, the last column, of any of the following data types: CSTRING with a length of 32,768 bytes or more, CLOB, OMNIDEX CLOB, BLOB, or OMNIDEX BLOB.

 

Backward Compatibility

Beginning with OMNIDEX version 4.1, data type declarations in the OMNIDEX environment catalog were changed to more closely match native database syntax. Specifically, declared lengths are now enclosed in parenthesis or omitted when defaults apply, and support for more data types has been added, like DOUBLE and TINYINT.

DATATYPE datatype(n)

Previous verions of OMNIDEX required a LENGTH keyword followed by the length, and data types like DOUBLE and TINYINT were declared as FLOAT LENGTH 8 and INTEGER LENTH 1, respectively.

The old declaractions are still supported for backward compatibility. However, DISC recommends using the new syntax in all new installations and converting old installations to use the new syntax. An easy way to convert an existing installation using the old syntax, to the new syntax is to use OADECOMP to decompile the existing environment catalog into an editable source file or use OAHELPER to generate a new environment source file.

When using the old style to declare data types, the length value is required for all data types.

DATATYPE datatype LENGTH n

Length values can be different when using the old syntax. See Data Types Quick Reference for a side-by-side comparison.

 

Data Type Quick Reference

Number

Data Type

Length - Old Syntax

Length - New Syntax

100

CHARACTER

# of characters

# of characters

201

C STRING

# of characters + 1

# of characters

1700

VARCHAR

# of characters

# of characters

1800

CLOB

# of characters

# of characters

102

NCHAR

# of characters * 2

# of characters

202

NC STRING

(# of characters + 1) * 2

# of characters

1701

NVARCHAR

(# of characters) * 2

# of characters

1801

NCLOB

(# of characters) * 2

# of characters

1799

OMNIDEX VARCHAR

(# of characters) + 4

# of characters

1899

OMNIDEX CLOB

(# of characters) + 4

# of characters

301

[SIGNED] TINYINT

1

 

401

UNSIGNED TINYINT

1

 

302

[SIGNED] SMALLINT

2

 

402

UNSIGNED SMALLINT

2

 

300

[SIGNED] INTEGER

1, 2, 4, 8

 

400

UNSIGNED INTEGER

1, 2, 4, 8

 

303

[SIGNED] BIGINT

8

 

403

UNSIGNED BIGINT

8

 

600

FLOAT

4, 8

 

605

DOUBLE

8

 

1000

DATE

10

 

1007

ODBC DATE

6

 

1009

DB2 DATE

6

 

1100

INFORMIX DATE

4

 

1101

ASCII DATE

6, 8

6, 8 (optional, default 8)

1102

OMNIDEX DATE

1 - 4

2 - 8 (optional, default 8)

1199

TIME

11

 

1200

ODBC TIME

6

 

1202

DB2 TIME

6

 

1207

OMNIDEX TIME

1 - 4

2 - 8 (optional, default 8)

1208

DATETIME

22

 

1206

ORACLE DATETIME

7

 

1205

ODBC DATETIME

6

 

1208

DB2 DATETIME

16

 

1206

INFORMIX DATETIME

24

 

1205

C DATETIME

4

 

1299

OMNIDEX DATETIME

1 - 8

2 - 16 (optional, default 16)

1900

BLOB

# of bytes

# of bytes

1999

OMNIDEX BLOB

# of bytes

# of bytes

 

 

Top