List:MySQL++« Previous MessageNext Message »
From:onlyreply-sql Date:June 1 2008 9:47am
Subject:mysqlpp::Query Issue
View as plain text  
Hi All, 

I'm not able to reuse mysqlpp::Query  object and program throws
exception.  Although,I'm calling    reset() function on
it.  Here si the code snippet...



    mysqlpp::Query sqlquery = commonDBCon.query(strquery);
    if (sqlresults = sqlquery.store()) {
       
    AppDN   = sqlresults[0]["AppDN"];
       
    AppName = sqlresults[0]["AppName"]; 
       
    AppDesc = sqlresults[0]["AppDescription"];
        sqlresults.clear();
        sqlquery.reset();
    }

    // Now, Load Application Step Items 
    sprintf(strquery,"select * from ApplicationStepItems where
AppDN=%d",nAppDN);
    mysqlpp::Query sqlquery2 =
pSystem->m_pCommon->commonDBCon.query(strquery);
    //sqlquery.storein(AppStepItems);
    AppStepItems_Module temp;
    if (sqlresults = sqlquery2.store()) {
        for (size_t i = 0; i
< sqlresults.num_rows(); ++i) {  
       
    //AppStepItems.push_back(sqlresults[i]);
       
    temp.StepNumber = sqlresults[i]["StepNumber"];
       
    temp.AppKeypadId = sqlresults[i]["AppKeypadId"];
       
    temp.NextStepNumber = sqlresults[i]["NextStepNumber"];
           
AppStepItems.push_back(temp);
      }
 }


Can anyone please suggest me the solution ?  
My requirements is just to  access multiple tables and store records in
appropriate structures/templates. 


thanks

Thread
MySQL example codejupiter.hce29 May
  • Re: MySQL example codeWarren Young29 May
  • mysqlpp::Query Issueonlyreply-sql1 Jun
    • Re: mysqlpp::Query IssueWarren Young2 Jun
Re: mysqlpp::Query Issueonlyreply-sql2 Jun
  • Re: mysqlpp::Query IssueWarren Young2 Jun
  • Re: mysqlpp::Query IssueAlexis Rodriguez Castedo2 Jun
Re: mysqlpp::Query Issuebsingh3 Jun