List:MySQL++« Previous MessageNext Message »
From:Bassam A. Al-Khaffaf Date:February 8 2007 4:09am
Subject:Strange error when to use MySQL++ 2.2.0 inplace of MySQL++ 2.1.1
View as plain text  
Dear All,

   This is my first email in this forum. I am writing a network application
that uses MySQL as the data repository using win32 C++ using Visual C++ 2005
express edition on windows xp in addition to MySQL++-2.1.1. 

 

However, I tried to use the latest version of MySQL++-2.2.0 that it just
recently issued instead of the prior one MySQL-2.1.1. Unfortunately, I am
getting runtime error when the execution calls out the store() function in
order to retrieve the result set to Result vector object.

 

I am catching that run time error and the message that I am getting is:

Query error: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near
';' at line 4

 

My code snippet is:

----------------------------------------------------------------------------
-----------------------------------------

#include <mysql++.h>

#include <result.h>

using namespace mysqlpp;

 

void Configurations::setConfigurationParametersDebugMode(Query *radiusQuery)

{

Result configResult;

 

try

{

*radiusQuery << "SELECT c.profile_name, c.authentication_port,
c.accounting_port, c.any_nas, s.secret_name, c.considration_id,
r.considration_comment, c.log_verbosity, c.format_id, l.format_name,
l.format_plugin\nFROM configurations_table AS c INNER JOIN
(shared_secrets_table AS s, realm_considration_table AS r,
logging_format_table AS l)\nON (c.secret_id = s.secret_id AND
c.considration_id = r.considration_id AND c.format_id = l.format_id)\nWHERE
c.active_profile = true;";

 

      cout << radiusQuery->preview() << endl << endl;

      

      configResult = radiusQuery->store();

}

 

      catch (const mysqlpp::BadQuery& er) {

            // Handle any query errors

            cerr << "Query error: " << er.what() << endl;

      }

      catch (const mysqlpp::BadConversion& er) {

            // Handle bad conversions; e.g. type mismatch populating 'stock'

            cerr << "Conversion error: " << er.what() << endl <<

                        "\tretrieved data size: " << er.retrieved <<

                        ", actual size: " << er.actual_size << endl;

      }

      catch (const mysqlpp::Exception& er) {

            // Catch-all for any other MySQL++ exceptions

            cerr << "Error: " << er.what() << endl;

      }

}

----------------------------------------------------------------------------
-----------------------------------------

 

 

Can anyone tell me why I am getting this unexpected error?

 

Your help is much appreciated

 

Regards

Bassam


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.29/673 - Release Date: 2/6/2007
5:52 PM
 

Thread
Strange error when to use MySQL++ 2.2.0 inplace of MySQL++ 2.1.1Bassam A. Al-Khaffaf8 Feb
  • Re: Strange error when to use MySQL++ 2.2.0 inplace of MySQL++ 2.1.1Jonathan Wakely8 Feb
RE: Strange error when to use MySQL++ 2.2.0 inplace of MySQL++ 2.1.1Bassam A. Al-Khaffaf8 Feb
  • Re: Strange error when to use MySQL++ 2.2.0 inplace of MySQL++ 2.1.1Warren Young8 Feb