List:MySQL++« Previous MessageNext Message »
From:Wilfred van Velzen Date:August 10 2010 6:20pm
Subject:Re: mysql_type_info::is_num_type() and sql_type() are gone in
3.1.0, what's the alternative?
View as plain text  
Sorry, my bad! These are 2 functions I added to the library myself.  ;)   (It was a year
ago when I did that, should have marked them as such!) 

Maybe they are usefull for addition to the library? Here they are: 

const enum_field_types sql_type() const { return deref().base_type_; } 
bool is_num_type() const { return IS_NUM(sql_type()); } 

But never the less, maybe there is a better way of coding with the functions available in
the library, what I want to do with the code below? 



Met vriendelijke groet / Best regards,
Wilfred van Velzen



>>> On 2010/08/10 at 19:38, "Wilfred van Velzen" <w.v.velzen@stripped>
> wrote:


Hi

In my project using 3.0.9, I had a piece of code that looked like this:

    const mysqlpp::String &str = row[x];
    std::string stdstring;

    if (  str.type().sql_type() == MYSQL_TYPE_DATE
       || str.type().is_num_type())
      stdstring = str.is_null() ? "0" : (const char *)str;
    else
      stdstring = str.is_null() ? "" : (const char *)str;

In 3.1.0 sql_type() and is_num_type() are gone... How do I accomplish the same thing in
3.1.0 ?


-- 
SERCOM Regeltechniek B.V.
Heereweg 9
2161 AB Lisse
Nederland
+31 (0)252 416530  (voice)
+31 (0)252 419481  (fax)

<http://www.sercom.nl/>


Op al onze offertes, op alle opdrachten aan ons en op alle met ons gesloten
overeenkomsten zijn toepasselijk de METAALUNIEVOORWAARDEN, gedeponeerd ter
Griffie van de Rechtbank te Rotterdam, zoals deze luiden volgens de
laatstelijk aldaar neergelegde tekst. De leveringsvoorwaarden worden u op
verzoek toegezonden.
---


Thread
mysql_type_info::is_num_type() and sql_type() are gone in3.1.0, what's the alternative?Wilfred van Velzen10 Aug
  • Re: mysql_type_info::is_num_type() and sql_type() are gone in 3.1.0, what's the alternative?Wilfred van Velzen10 Aug
    • Re: mysql_type_info::is_num_type() and sql_type() are gone in 3.1.0,what's the alternative?Warren Young11 Aug