List:MySQL++« Previous MessageNext Message »
From:Chris Morgan Date:December 17 2009 6:15pm
Subject:Re: SSQLS does not read one particular value
View as plain text  
On Thu, Dec 17, 2009 at 4:40 AM, Peter Vanhee <peter.vanhee@stripped>wrote:

> Hey all,
>
> Using SSQLS I recently started having problems reading one particular
> value.
>
> This is the defintion of the SSQLS in BrixClass.h
>
> sql_create_7(BrixClass, 1, 7,
>        mysqlpp::sql_int_unsigned, id,
>        mysqlpp::sql_int_unsigned, centroid,
>        mysqlpp::sql_double, threshold)
>

This isn't valid.  The sql_create_7 macro requires 17 (3 + [7*2])
arguments.  I'm assuming this is just a typo.


>
> and I read in the structures like
>
> // with initiliazed con (mysqlpp::Connection object)
> mysqlpp::Query query = con->query();
> query << "SELECT Centroid, ClassID, Threshold FROM Class WHERE ClassID =
> 5";
>
>
Your query uses ClassID instead of id, is this a typo?


> vector<BrixClass> classes;
> query.storein(classes);
>
> // take the first element
> BrixClass class = classes[0];
>
>
> then, class.id will always be 0, while the other elements (centroid and
> threshold)
> are properly set.
>
> No matter how I turn around the order in the SELECT, the id will always be
> zero.
> However, when I read the row without SSQLS but instead use mysqlpp::Row
> I get correct values.
>
> Any idea?
>
> Thanks,
> Peter
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:
> http://lists.mysql.com/plusplus?unsub=1
>
>

Thread
SSQLS does not read one particular valuePeter Vanhee17 Dec
  • Re: SSQLS does not read one particular valueChris Morgan17 Dec
    • Re: SSQLS does not read one particular valuePeter Vanhee17 Dec
      • Re: SSQLS does not read one particular valueChris Morgan17 Dec
        • Re: SSQLS does not read one particular valuePeter Vanhee17 Dec
          • Re: SSQLS does not read one particular valueChris Morgan17 Dec
          • Re: SSQLS does not read one particular valueWarren Young17 Dec