SQL/MX 3.2.1 Programming Manual for C and COBOL (H06.26+, J06.15+)

Host Variables in C/C++ Programs
HP NonStop SQL/MX Release 3.2.1 Programming Manual for C and COBOL663854-005
3-10
Using Corresponding SQL and C Data Types
INT[EGER]
UNSIGNED
unsigned int unsigned long unsigned int
NUMERIC(5-9)
long long (32-bit
integer)
long (64-bit
integer)
LARGEINT
long long long long
(64-bit
integer)
long long
(64-bit
integer)
Note.
You can declare an Unsigned Numeric variable and then store a negative BigNum value.
Unsigned Numeric and Signed Numeric binary formats are the same for BigNum values,
with the exception of the sign bit.
The unsigned long data type is not supported in 64-bit embedded SQL/MX programs.
Table 3-2. Corresponding SQL, C Host Variable Data Types, and Translated C
Declarations for Float Data Types
SQL Data Type
C Host Variable
Data Type
Translated C
Declaration
REAL
FLOAT (1 to 22 bits)
float
* float (Tandem format)
FLOAT (23 to 54 bits)
DOUBLE PRECISION
double
*
double (Tandem format)
REAL float
**
float (IEEE format)
FLOAT (1 to 52 bits)
DOUBLE PRECISION
double
**
double (IEEE format)
* Tandem floating point is specified during compilation.
** IEEE floating point is specified during compilation.
Table 3-1. Corresponding SQL, C Host Variable Data Types, and Translated C
Declarations for NUMERIC, DECIMAL, PIC, SMALLINT, and LARGEINT Data
Types
SQL Data Type C Host Variable
Data Type
Translated C
Declaration (32-
bit Address
Model)
Translated C
Declaration (64-
bit Address
Model)
*
These host variable data types are extensions.
**
x is computed based on precision p.
l A positive integer that represents the length.
s A positive integer that represents the scale of the number.