SQL/MX 3.2 Programming Manual for C and COBOL (H06.25+, J06.14+)

Host Variables in C/C++ Programs
HP NonStop SQL/MX Release 3.2 Programming Manual for C and COBOL663854-002
3-21
Numeric Data
Assignment Functions
Comparison Functions
Conversion Functions
Arithmetic Functions
Assignment Functions
You can assign an Int64 value to a BigNum host variable or a BigNum value to an
Int64 variable using the assignment functions.
SQL_BigNumAssign Function
The SQL_BigNumAssign function assigns an Int64 value to a BigNum host variable:
int SQL_BignumAssignI64( BignumExt result, UInt16 resultLen,
Int64 valOp)
The SQL_BigNumAssign function sets the value of result from valOp.
If the assignment is successful, this function returns 0. Otherwise, the function returns
an EXE_NUMERIC_OVERFLOW error, if the resultLen is not large enough to hold
the valOp data.
SQL_BigNumI64Assign
The SQL_BigNumI64Assign function assigns a BigNum value to an Int64 variable:
int SQL_BignumI64Assign ( Int64 * result, Bignum valOp,
UInt16 valOpLen )
The SQL_BigNumI64Assign function sets the value of result from valOp.
If the assignment is successful, this function returns 0. Otherwise, the function returns
an EXE_NUMERIC_OVERFLOW error.
Comparison Functions
You can compare two BigNum values by using the comparison functions.
SQL_BigNumCmp
SQL_BigNumCmp function compares two BigNum values:
int SQL_BignumCmp( Int16 * result, BignumExt operand1,
UInt16 operand1Len, BignumExt operand2, UInt16 operand2Len)
Sets the result to:
0, if operand1 is equal to operand2
1, if operand1 is greater than operand2
-1, if operand1 is less than operand2