List:MySQL++« Previous MessageNext Message »
From:Joseph Hesse Date:August 16 2012 10:03am
Subject:Problem with types in sql_types.h
View as plain text  
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 =;

   for(size_t i = 0; i < res.num_rows(); ++i)
     x = res[i]["Cost"];     // THIS LINE WON'T COMPILE
     cout << x << endl;

Thank you,
Problem with types in sql_types.hJoseph Hesse16 Aug
  • Re: Problem with types in sql_types.hWarren Young16 Aug
    • Re: Problem with types in sql_types.hMickael Wolff16 Aug
      • Re: Problem with types in sql_types.hMickael Wolff17 Aug