Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
Guardian Native C Library Calls (a - e) dec_to_longlong(3)
NAME
dec_to_longlong - Converts SQL DECIMAL value stored in a C array of decimal to a C long
long value
LIBRARY
For G-series Guardian native processes: $SYSTEM.SYSnn.ZCRESRL
For G-series OSS native processes: /G/system/sysnn/zcresrl
For H-series Guardian native processes: $SYSTEM.ZDLLnnn.ZCREDLL
For H-series OSS processes: /G/systemzdllsnnn/zcredll
SYNOPSIS
#include <sql.h>
int dec_to_longlong (
decimal *dec_ary,
int chr_count,
long long *ll_val);
PARAMETERS
dec_ary Points to the first character of the decimal array that contains the SQL
DECIMAL value to convert.
chr_count Specifies the number of valid DECIMAL characters in dec_ary.
ll_val Points to the variable of type long long where dec_to_longlong() stores the con-
verted DECIMAL value.
DESCRIPTION
The dec_to_longlong() function converts a SQL DECIMAL value stored in a C array of type
decimal to a C type long long value.
For more information regarding the representation of SQL DECIMAL values in C arrays of
decimal, refer to the NonStop SQL/MP Programming Manual for C.
RETURN VALUES
Upon successful completion, the value 0 (zero) is returned. Otherwise, dec_to_longlong()
returns one of the following values:
1 Indicates that significant digits of the DECIMAL value were truncated in the
conversion. The converted value exceeds the bounds of a long long value.
2 Indicates that the chr_count parameter was an invalid value.
3 Indicates that the dec_ary parameter contained characters that are not valid in
SQL DECIMAL values.
When dec_to_longlong() returns a nonzero value to indicate the conversion was not successful,
the value stored in ll_val is undefined.
RELATED INFORMATION
Functions: longlong_to_dec(3).
STANDARDS CONFORMANCE
The dec_to_longlong() function is an HP extension to the XPG4 Version 2 specification.
527192-007 Hewlett-Packard Company 1−49