List:MySQL++« Previous MessageNext Message »
From:Eric Sepich Date:December 31 2010 12:03am
Subject:Re: Return the number of fields in a 'vector<Row> myresultset;'.
View as plain text  
Oh! Thanks!

On Thu, Dec 30, 2010 at 2:38 PM, Warren Young <mysqlpp@stripped> wrote:

> On 12/30/2010 1:52 PM, Chris Morgan wrote:
>
>>
>> If you want the number of columns in a particular mysqlpp::Row, you
>> need to use myslqpp::Row::size()
>>
>
> That, or you can check with the result set object:
>
>        mysqlpp::StoreQueryResult res = query.store();
>        cout << "Columns: " << res.num_fields() << endl;
>
>  mysqlpp::StoreQueryResult myresultset = query.store();
>>
>> for (unsigned int i = 0; i<  myresultset.num_rows(); i++)
>> {
>>   std::cout<<  "Row "<<  i<<  " Size: "<< 
> myresultset[i].size()<<
>>  std::endl;
>> }
>>
>
> No need to check each row.  They'll all have the same number of columns.
>  Each Row object refers back to the ResultBase derivative that created it
> for things like column information, so they can't be mismatched.
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:
> http://lists.mysql.com/plusplus?unsub=1
>
>

Thread
Return the number of fields in a 'vector<Row> myresultset;'.Eric Sepich30 Dec
  • Re: Return the number of fields in a 'vector<Row> myresultset;'.Tomalak Geret'kal30 Dec
    • Re: Return the number of fields in a 'vector<Row> myresultset;'.Warren Young30 Dec
  • Re: Return the number of fields in a 'vector<Row> myresultset;'.Chris Morgan30 Dec
    • Re: Return the number of fields in a 'vector<Row> myresultset;'.Warren Young30 Dec
      • Re: Return the number of fields in a 'vector<Row> myresultset;'.Eric Sepich31 Dec