Beispiel #1
0
 void setDecimal(MYSQL_BIND& bind, unsigned long& length, const Decimal& data)
 {
   std::ostringstream ds;
   ds.precision(24);
   data.print(ds, Decimal::infinityLong);
   std::string d = ds.str();
   reserve(bind, d.size());
   d.copy(static_cast<char*>(bind.buffer), d.size());
   bind.buffer_type = MYSQL_TYPE_NEWDECIMAL;
   bind.is_null = 0;
   length = d.size();
   bind.length = &length;
   bind.is_unsigned = 0;
 }