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 COBOL—663854-005
3-7
Floating-Point Host Variables
{[signed] | unsigned} long
specifies the data type of a target host variable for a column of the SQL data type:
INT[EGER] [SIGNED|UNSIGNED} for 32-bit data model
LARGEINT for 64 bit data model
long long
specifies the data type of a target host variable for a column of the SQL data type:
LARGEINT
Floating-Point Host Variables
With NonStop SQL/MX Release 2.x, you can choose to declare floating-point host
variables with a Tandem floating-point format or the ANSI IEEE floating-point format.
The storage and precision of IEEE floating-point data types is different from that of
Tandem floating-point data types, as noted in these summaries. Tandem floating-point
data types are stored in 4 bytes (REAL) or 8 bytes (DOUBLE), depending on their
precision. ANSI IEEE floating-point data type FLOAT(p) declarations are stored in 8
bytes regardless of the precision.
float
specifies the data type of a target host variable for a column of this SQL data type:
REAL
Tandem floating-point REAL data type is stored with 22 bits of precision and 9 bits
of exponent. The precision corresponds to the precision of the column value. IEEE
floating-point format REAL is stored in 4 bytes with 23 bits of binary precision and
8 bits of exponent.
Note. The unsigned long data type is not supported in 64-bit embedded SQL/MX programs.
Note. The long data type corresponds to a 32-bit integer in programs compiled for the 32-bit
address model and to a 64-bit integer in programs compiled for the 64-bit address model.
Therefore, HP recommends that you use the int
data type for 32-bit integer host variable.
Note. The unsigned long long data type is not supported in embedded SQL/MX programs.
Note. The floating-point format for SQL/MP tables is Tandem. The floating-point format for
SQL/MX format tables is IEEE. Use the -o preprocessor option to change the format of data
that is input or output to host variables in an embedded program. See Running the
SQL/MX C/C++ Preprocessor on page 15-8.










