Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

Field Types

c-treeDB .NET supports all original c-tree Plus field types and includes redefinition for new field types. For compatibility reasons, the original c-tree Plus field types can be used, but FairCom suggests using the new c-treeDB .NET field types.

Note that the "c-treeDB .NET field types" do not represent new field types, but just a new name of the existing c-tree Plus field types. The new naming convention is used in the c-treeSQL product line, and offers a better description of the fields.

c-treeDB .NET field types are defined in the enum type FIELD_TYPE that must be used every time a field type is needed (see above sample code).

c-treeDB .NET Field Type

c-tree Plus Field Type

Equivalent Data Type


Implementation

BOOL

CT_BOOL

CTBOOL

One byte Boolean

TINYINT

CT_CHAR

CTSIGNED

Signed one byte integer

UTINYINT

CT_CHARU

CTUNSIGNED

Unsigned one byte integer

SMALLINT

CT_INT2

CTSIGNED

Signed two-byte integer

USMALLINT

CT_INT2U

CTUNSIGNED

Unsigned two-byte integer

INTEGER

CT_INT4

CTSIGNED

Signed four-byte integer

UINTEGER

CT_INT4U

CTUNSIGNED

Unsigned four-byte integer

MONEY

CT_MONEY

CTMONEY

Signed four-byte integer interpreted as number of pennies (two fixed decimal places) up to a precision of 9.

DATE

CT_DATE

CTDATE

Unsigned four-byte integer interpreted as date

TIME

CT_TIME

CTTIME

Unsigned four-byte integer interpreted as time

FLOAT

CT_SFLOAT

CTFLOAT

Four-byte floating point

DOUBL

CT_DFLOAT

CTFLOAT

Eight-byte floating point

TIMESTAMP

CT_TIMES

CTDATETIME

Time stamp

EFLOAT

CT_EFLOAT

CTFLOAT

Extended precision floating point (not supported as a key segment)

BINARY

CT_ARRAY

pTEXT, pUTEXT

Arbitrary fixed length data. Fixed length binary data

CHARS

CT_FSTRING

pTEXT

Fixed length delimited data. Fixed length string data

FPSTRING

CT_FPSTRING

pTEXT

Fixed length data with 1-byte length count

F2STRING

CT_F2STRING

pTEXT

Fixed length data with 2-byte length count

F4STRING

CT_F4STRING

pTEXT

Fixed length data with 4-byte length count

BIGINT

CT_BIGINT

CTBIGINT

Eight-byte signed integer

NUMBER

CT_NUMBER

CTNUMBER

Scaled BCD number

CURRENCY

CT_CURRENCY

CTCURRENCY

Eight-byte signed integer interpreted as currency value with four fixed decimal digits

VPSTRING

CT_PSTRING

pTEXT

Varying length field data with 1-byte length count

VARBINARY

CT_2STRING

pTEXT

Varying length field data with 2-byte length count. Variable length binary data of up to 65,535 bytes

LVB

CT_4STRING

pTEXT

Varying length field data with 4-byte length count. Variable length binary data of up to 4,294,967,295 bytes

VARCHAR or LVC

CT_STRING

pTEXT

Varying length field delimited data. Variable length string data

TOCIndex