dbTalk Databases Forums  

unexpected abortion when printing rows

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss unexpected abortion when printing rows in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ZeeGeek
 
Posts: n/a

Default unexpected abortion when printing rows - 08-22-2005 , 12:35 AM






------=_Part_2535_7678554.1124688946330
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I used ResUse as the result type and printed rows in a while loop, but when=
=20
I used this method in a class member function, it would abort after printin=
g=20
the lines, the codes in the function are:

mysqlpp::Query query =3D con.query();
mysqlpp::ResUse res;
mysqlpp::Row row;

query << "select * from db_entry";

res =3D query.use();
while (row =3D res.fetch_row()) {
std::cout << row["id"] << std::endl;
}

but it didn't abort if I just put them in main() without using class. Am I=
=20
missing any important thing?

--=20
Dell Inspiron 600m
Pentium-M 1.6G
512MB, 60G
ATI 9000 Mobility

------=_Part_2535_7678554.1124688946330--

Reply With Quote
  #2  
Old   
ZeeGeek
 
Posts: n/a

Default Re: unexpected abortion when printing rows - 08-22-2005 , 05:31 AM






On 8/22/05, ZeeGeek <zeegeek (AT) gmail (DOT) com> wrote:
Quote:
I used ResUse as the result type and printed rows in a while loop, but wh=
en
I used this method in a class member function, it would abort after print=
ing
the lines, the codes in the function are:
=20
mysqlpp::Query query =3D con.query();
mysqlpp::ResUse res;
mysqlpp::Row row;
=20
query << "select * from db_entry";
=20
res =3D query.use();
while (row =3D res.fetch_row()) {
std::cout << row["id"] << std::endl;
}
=20
but it didn't abort if I just put them in main() without using class. Am=
I
missing any important thing?
=20
It seems that it had thrown out an "end of result" exception and I
didn't catch it so it aborted, but I still don't know why it just
happened when in class member functions.

Quote:
--=20
Dell Inspiron 600m
Pentium-M 1.6G
512MB, 60G
ATI 9000 Mobility=20

--=20
Dell Inspiron 600m
Pentium-M 1.6G
512MB, 60G
ATI 9000 Mobility

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Warren Young
 
Posts: n/a

Default Re: unexpected abortion when printing rows - 08-22-2005 , 05:27 PM



ZeeGeek wrote:
Quote:
It seems that it had thrown out an "end of result" exception
Read examples/usequery.cpp.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.