Data Types

This appendix describes the Ingres data types used by OpenAPI.

Previous Topic

Ingres Data Types

Ingres data types are described by the information conveyed in the IIAPI_DESCRIPTOR structure. This structure describes the data type, length, and precision of OpenAPI data.

The following table provides the data type, length, and precision value for each Ingres data type and maps the data type to its corresponding C type and SQL type. The following symbols are used in the table:

Lengths, precisions, or scales that are not required are shown as 0 in the table.

If the C type is shown as none, a character buffer of the appropriate length can be used to store the data value and IIapi_convertData() or IIapi_formatData() can be used to convert the data value to a type that has a corresponding C type.

The following table lists the Ingres data types:

Data Type

Length

Precision/
Scale

C Type

SQL Type

BLOB?

IIAPI_BYTE_TYPE

n

0/0

char*

byte(n)

no

IIAPI_CHA_TYPE

n

0/0

char*

char(n)

no

IIAPI_CHR_TYPE

n

0/0

char*

c(n)

no

IIAPI_HNDL_TYPE

4

0/0

void*

n/a

no

IIAPI_DATE_TYPE

4

0/0

none

ansidate

no

IIAPI_DEC_TYPE

1-16 (dep. on precision)

p/s

none

decimal(p,s)

no

IIAPI_INTDS_TYPE

12

p/0

none

interval day to second

no

IIAPI_DTE_TYPE

12

0/0

none

ingresdate

no

IIAPI_FLT_TYPE

4
8

p/0

float
double

float4/real
float8/float

no

IIAPI_INT_TYPE

1
2
4
8

0/0

char
short
long
long long

integer1
integer2/smallint
integer4/integer
integer8/bigint

no

IIAPI_INTYM_TYPE

3

p/0

none

interval year to month

no

IIAPI_LOGKEY_TYPE

16

0/0

char*

object_key

no

IIAPI_LBYTE_TYPE

(max 2 GB)

0/0

char*

long byte

yes

IIAPI_LNVCH_TYPE

(max 2 GB)

0/0

short*

long nvarchar

yes

IIAPI_LVCH_TYPE

(max 2 GB)

0/0

char*

long varchar

yes

IIAPI_LTXT_TYPE

n

0/0

char*

null

no

IIAPI_MNY_TYPE

8

p/0

none

money

no

IIAPI_NCHA_TYPE

n

0/0

short*

nchar(n)

no

IIAPI_NVCH_TYPE

n

0/0

short*

nvarchar(n)

no

IIAPI_TABKEY_TYPE

8

0/0

char*

table_key

no

IIAPI_TIME_TYPE

10

p/0

none

time with local time zone

no

IIAPI_TMWO_TYPE

10

p/0

none

time without time zone

no

IIAPI_TMTZ_TYPE

10

p/0

none

time with time zone

no

IIAPI_TSWO_TYPE

14

p/0

none

timestamp without time zone

no

IIAPI_TSTZ_TYPE

14

p/0

none

timestamp with time zone

no

IIAPI_TS_TYPE

14

p/0

none

timestamp with local time zone

no

IIAPI_TXT_TYPE

n

0/0

char*

text(n)

no

IIAPI_VBYTE_TYPE

n

0/0

char*

varbyte(n)

no

IIAPI_VCH_TYPE

n

0/0

char*

varchar(n)

no

Previous Topic

Data Type Descriptions

Ingres data types are described as follows.


© 2007 Ingres Corporation. All rights reserved.