
Host Variables
HP NonStop SQL/MP Programming Manual for C—429847-008
2-4
Using Corresponding SQL and C Data Types
Table 2-2. Corresponding SQL and C Numeric, Date-Time, and INTERVAL Data
Types
SQL/MP Data Type
C Data Type
Numeric Data Types
NUMERIC (1 to 4,
s
) SIGNED
short
NUMERIC (1 to 4,
s
) UNSIGNED
unsigned short
NUMERIC (5 to 9,
s
) SIGNED
long
NUMERIC (5 to 9,
s
) UNSIGNED
unsigned long
NUMERIC (10 to 18,
s
) SIGNED
long long
PIC 9(
l
-
s
)V9(
s
) COMP
Same as NUMERIC
DECIMAL (l,
s
)
decimal[
l
+ 1]**
PIC 9(
l
-
s
)V9(
s
) decimal[
l
+ 1]**
SMALLINT SIGNED
short
SMALLINT UNSIGNED
unsigned short
INTEGER SIGNED
long
INTEGER UNSIGNED
unsigned long
LARGEINT SIGNED
long long
FLOAT (1 to 22 bits)
float
REAL float
FLOAT (23 to 54 bits)
double
DOUBLE PRECISION
double
Date-Time and INTERVAL Data Types
DATETIME, TIMESTAMP, DATE, TIME
char[
l
+ 1]*
INTERVAL
char[
l
+ 1]***
l
A positive integer that represents the length. For DECIMAL,
l
must range from 1 – 18.
s
A positive integer that represents the scale of the number.
*
An extra byte is generated as a place holder for a null terminator.
**
The decimal data type is normally used to declare an array that can hold all the digit characters, the
sign, and, optionally, a null terminator. The size of the array should be no more than 20 (19 plus an
extra byte for the null terminator), or 21 (20 plus an extra byte for the null terminator) if a separate
sign is used
.
***
An INTERVAL data type has an extra byte for a sign.
Содержание NonStop SQL/MP
Страница 4: ......
Страница 14: ...Contents HP NonStop SQL MP Programming Manual for C 429847 008 x ...
Страница 34: ...Introduction HP NonStop SQL MP Programming Manual for C 429847 008 1 8 SQL MP Version Management ...
Страница 60: ...Host Variables HP NonStop SQL MP Programming Manual for C 429847 008 2 26 VARCHAR Data Type ...
Страница 68: ...SQL MP Statements and Directives HP NonStop SQL MP Programming Manual for C 429847 008 3 8 Finding Information ...
Страница 156: ...Explicit Program Compilation HP NonStop SQL MP Programming Manual for C 429847 008 6 40 SQL Program Files ...
Страница 264: ...Dynamic SQL Operations HP NonStop SQL MP Programming Manual for C 429847 008 10 66 Detailed Dynamic SQL Program ...
Страница 294: ...SQL MP Sample Database HP NonStop SQL MP Programming Manual for C 429847 008 A 6 ...
Страница 300: ...Memory Considerations HP NonStop SQL MP Programming Manual for C 429847 008 B 6 Avoiding Memory Stack Overflows ...
Страница 304: ...Maximizing Local Autonomy HP NonStop SQL MP Programming Manual for C 429847 008 C 4 Skipping Unavailable Partitions ...