I am trying to use the type "mysqlpp::sql_double_null" defined in
lib/sql_types.h and my program won't compile.
The field "Cost", in table "Orders", is decimal(5,2) and can be NULL.
The following code fragment shows my problem.
/////////////////////////////////////////
int main(int argc, char *argv[])
{
mysqlpp::sql_double_null x; // DEFINE x USING THE TYPES IN sql_types.h
Connection conn("MyPP", "localhost", ...);
Query query = conn.query("select * from Orders");
StoreQueryResult res = query.store();
for(size_t i = 0; i < res.num_rows(); ++i)
{
x = res[i]["Cost"]; // THIS LINE WON'T COMPILE
cout << x << endl;
}
/////////////////////////////////////////
Thank you,
Joe