Figure 115. DB2 Server for VSE & VM Data Types for C
Description |
DB2 Server for VSE & VM Keyword |
Equivalent C Declaration |
---|---|---|
A binary integer of 31 bits, plus sign. | INTEGER or INT |
long or
|
A binary integer of 15 bits, plus sign. | SMALLINT |
short or
|
A packed decimal number, precision p, scale s (1<=p<=31 and 0<=s<=p). In storage, the number occupies a maximum of 16 bytes. Precision is the total number of digits. Scale is the number of those digits that are to the right of the decimal point. |
DECIMAL[(p[,s])]
|
decimal(p,s)
|
A single-precision (4-byte) floating-point number, in short System/390 floating-point format. |
REAL or
| FLOAT |
A double-precision (8-byte) floating-point number, in long System/390 floating-point format. |
FLOAT or
| DOUBLE |
A fixed-length character string of length 1. | CHARACTER[(1)] or CHAR[(1)] | char or char ..[1] |
A NUL-terminated character string of maximum defined length n. Range of n is 1 <= n <= 254. The terminating NUL is mandatory upon input. | VARCHAR(n) | char ..[n+1] |
A NUL-terminated character string of maximum defined length of 32 767 bytes, subject to certain usage limitations. Range of n is 255 <= n <= 32 766. The terminating NUL is mandatory upon input. | LONG VARCHAR | char ..[n+1] |
A varying-length character string of maximum length n. If n > 254 or <= 32 767, this data type is considered a long field. See Using Long Strings for more information. | VARCHAR(n) | struct { short ..; char ..[n]; } |
A varying-length character string of maximum length 32 767 bytes, subject to certain usage limitations. | LONG VARCHAR | struct { short ..; char ..[n]; } |
A fixed-length string of n DBCS characters where 0 < n <= 127. | GRAPHIC[(n)] | Not supported |
A varying-length string of n DBCS characters. If n > 127 or <= 16 383, this data type is considered a long field. See Using Long Strings for more information. | VARGRAPHIC(n) | Not supported |
A varying-length string of DBCS characters of maximum length 16 383, subject to certain usage limitations. | LONG VARGRAPHIC | Not supported |
A NUL-terminated or varying-length character string representing a date. | DATE | see VARCHAR(n) |
A NUL-terminated or varying-length character string representing a time. | TIME | see VARCHAR(n) |
A NUL-terminated or varying-length character string representing a timestamp. | TIMESTAMP | see VARCHAR(n) |
Notes: