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-25
Numeric 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
If the comparison is successful, this function returns 0, otherwise, the function returns -
1.
Conversion Functions
You can convert a BigNum value to an ASCII character string or convert an ASCII
character string to a BigNum value, or find the number of bytes required for a BigNum
value, if given a precision, using the conversion functions.
SQL_BignumFromStr
The SQL_BignumFromStr function converts an ASCII string to a BigNum value:
int SQL_BignumFromStr( BignumExt result, UInt16 resultLen,
char const *str)
This function converts the str operand to a BigNum value and stores the value in the
result parameter.
If the conversion is successful, this function returns 0. Otherwise, the function returns
an EXE_NUMERIC_OVERFLOW error.
SQL_BignumToStr










