SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)

Host Variables in C/C++ Programs
HP NonStop SQL/MX Programming Manual for C and COBOL523627-004
3-6
Floating-Point Host Variables
PIC[TURE] [S]9(l-s)V9(s) COMP
is the same as {[signed] | unsigned} NUMERIC (p, s).
{[signed] | unsigned} DECIMAL(l, s)
specifies the data type of a target host variable for a column of one of these SQL
data types:
DECIMAL (l, s) [SIGNED|UNSIGNED]
PIC[TURE] [S] 9(l-s) V9(s) DISPLAY [SIGN IS LEADING]
The length l corresponds to the number of digits in the column value. The scale s
corresponds to the scale of the column value. The value l-s is the number of
digits in the integral part of the column value.
PIC[TURE] [S]9(l-s)V9(s)
is the same as {[signed] | unsigned} DECIMAL(l, s).
{[signed] | unsigned} short
specifies the data type of a target host variable for a column of the SQL data type:
SMALLINT [SIGNED|UNSIGNED]
{[signed] | unsigned} long
specifies the data type of a target host variable for a column of the SQL data type:
INT[EGER] [SIGNED|UNSIGNED}
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.
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.