logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: Aborted Message on Query: msg#00037

db.mysql.c++

Subject: Re: Aborted Message on Query

Daniel Hoult wrote:
My program was running great, until I added another query execution...
I can run this fine with just a call to either putorders or putunits,
but when I call both I get an Aborted message on the first
query.exec(sql) call in whichever function was called second. I have
wasted so much time trying to figure this out and am just banging my
head against the wall.
Any idea what the problem might be?

This is in main:

mysqlconn.connect("weeklyreports","localhost","user","pass");
if(mysqlconn.connected()){
putunits(mysqlconn,vUnits);
putorders(mysqlconn,vOrders,vLoads);
mysqlconn.close();
}

My 2 function calls:


void putunits(Connection mysqlconn){
char sql[100];
Query query(&mysqlconn,false);
strcpy(sql,"delete from units");
query.exec(sql);
/* iterate through a vector and do a query.exec(sql) where sql
in an insert.. */
return;
}
void putorders(Connection mysqlconn){
char sql[300];
Query query(&mysqlconn,false);
strcpy(sql,"delete from orders");
query.exec(sql); // as soon as it tries this it dies with an
Abort message.
strcpy(sql,"delete from loads");
query.exec(sql);
/* iterate through a vector and do a query.exec(sql) where sql
in an insert.. */
return;
}



First, no need for sql variable. You can just pass a constant string.

Second, and far more important, with delete statement there is nothing to iterate through an no vectors.

--

Sincerely,

--
For technical support contracts, go to https://order.mysql.com/?ref=msmi
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <sinisa@xxxxxxxxx>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB
/_/ /_/\_, /___/\___\_\___/ Full time Developer and Support Coordinator
<___/ www.mysql.com Larnaca, Cyprus

Meet the MySQL at User Conference ! (April 14-16, 2004)
http://www.mysql.com/uc2004/

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsub=gcdmc-plusplus@xxxxxxxxxxx







Only community members can participate in forum threads. You must Register or log in to contribute.

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo