mpf_class
values from GMP library
source.C
#include <x/sql/decimal.H> mpf_class value; conn->execute("INSERT INTO table VALUES(?)", value);Makefile.am
app_LDFLAGS=-lsqldecimal
decimal
SQL columns can always be
INSERT
ed or SELECT
ed as
text string values, float
s,
double
s, or maybe even
int
s or long long
s.
LIBCXX and
unixODBC
handle the data type conversion automatically.
The GMP library implements arbitrary precision math that does not suffer from
floating point round-off errors, and is a natural fit for the
SQL decimal
datatype.
To use GMP library's mpf_class
values:
Include the <x/sql/decimal.H
> file.
Link with -lsqldecimal
.
This enables mpf_class
to be used directly
with execute
() or
execute_vector
();
or receive fetched column values with
fetch
()
or fetch_vectors
().