Table 2-2. Corresponding Sql And C Numeric, Date-Time, And Interval Data Types - HP NonStop SQL/MP Programming Manual

For c
Table of Contents

Advertisement

Host Variables
Table 2-2. Corresponding SQL and C Numeric, Date-Time, and INTERVAL Data
Types
SQL/MP Data Type
Numeric Data Types
NUMERIC (1 to 4,s) SIGNED
NUMERIC (1 to 4,s) UNSIGNED
NUMERIC (5 to 9,s) SIGNED
NUMERIC (5 to 9,s) UNSIGNED
NUMERIC (10 to 18,s) SIGNED
PIC 9(l-s)V9(s) COMP
DECIMAL (l, s)
PIC 9(l-s)V9(s)
SMALLINT SIGNED
SMALLINT UNSIGNED
INTEGER SIGNED
INTEGER UNSIGNED
LARGEINT SIGNED
FLOAT (1 to 22 bits)
REAL
FLOAT (23 to 54 bits)
DOUBLE PRECISION
Date-Time and INTERVAL Data Types
DATETIME, TIMESTAMP, DATE, TIME
INTERVAL
A positive integer that represents the length. For DECIMAL, l must range from 1 – 18.
l
A positive integer that represents the scale of the number.
s
*
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.
HP NonStop SQL/MP Programming Manual for C—429847-008
.
2-4
Using Corresponding SQL and C Data Types
C Data Type
short
unsigned short
long
unsigned long
long long
Same as NUMERIC
decimal[l + 1] **
decimal[l + 1] **
short
unsigned short
long
unsigned long
long long
float
float
double
double
char[l + 1] *
char[l + 1] ***

Advertisement

Table of Contents
loading

Table of Contents