Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-109
longlong_to_dec (supplementary)
longlong_to_dec (supplementary)
The longlong_to_dec function converts a long long value to an SQL DECIMAL value
and stores the converted value in a C array of decimal.
ll_val
specifies the long long value to convert.
dec_ary
points to the first character of the decimal array where longlong_to_dec stores the
converted DECIMAL value.
ary_size
specifies the size (in characters) of the array denoted by *dec_ary.
sign_type
specifies what type of sign representation to use for the converted DECIMAL value.
The valid sign_type values are:
Return Value
is zero if the conversion is successful; otherwise, longlong_to_dec returns one of
these status codes:
#include <sqlh>
int longlong_to_dec(long long ll_val, decimal *dec_ary,
int ary_size, int sign_type);
0
Convert to an unsigned DECIMAL value.
1
Convert to a DECIMAL value with an embedded leading sign.
2
Convert to a DECIMAL value with a separate leading sign character.
3
Convert to a DECIMAL value with an embedded trailing sign.
4
Convert to a DECIMAL value with a separate trailing sign character.
1
Indicates that significant digits of ll_val were truncated in the conversion; that
is, the converted value exceeded the specified size of the decimal array.
2
Indicates that the ary_size argument had an invalid value. An invalid value is
less than zero or greater than 19.
3
Indicates that ll_val was negative, but sign_type was 0 (a request for
conversion to an unsigned DECIMAL value).
4
Indicates that the sign_type argument had an invalid value.