List:General Discussion« Previous MessageNext Message »
From:<sinisa Date:July 25 2000 11:30am
Subject:Re: MySQL++ - row disappears
View as plain text  
Miklos Niedermayer writes:
 > 
 > Hi!
 > 
 > Is this a bug, or feauture, or what?
 > 
 >     Result res = q.store ();
 >     Row row;
 >     Result::iterator i;
 >     i = res.begin ();
 >     row = *i;
 > //    un = row[0];
 >     q << "update staff_utmp set time=NOW() where user='" << row[0]
<< "'";
 >     q.execute ();
 >     un=row[0];
 > 
 > So the above example is wrong, i had to move un=row[0] 3 lines up
 > (commented), because if i do another query with q  (like above), 
 > row will contain something else.  I think it should not.
 > 
 >   I'll look into it more closer, i'm just finished searching for hours
 > what the hell is the problem with my string library...  yeah the problem
 > was this.
 > 
 > Bye
 > 
 > Mico

Hi!

As explained in detail in MySQL++ manual, streaming with queries is
done for queries that return results. 

For others, like UPDATE use exec() method.

Regards,

Sinisa

+----------------------------------------------------------------------+
|      ____  __     _____   _____  ___     ==  MySQL AB                |
|     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sinisa Milivojevic          |
|    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:sinisa@stripped     |
|   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Larnaka, Cyprus             |
|  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____                             |
|  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^                            |
|             /*/             \*\                Developers Team       |
+----------------------------------------------------------------------+
Thread
MySQL++ - row disappearsMiklos Niedermayer24 Jul
  • Re: MySQL++ - row disappearssinisa25 Jul
  • ODBC and JDBCSimon Baillargeon25 Jul
    • RE: ODBC and JDBCCraig Vincent25 Jul
    • Re: ODBC and JDBCSharif Islam25 Jul
  • MySQL ManualSimon Baillargeon25 Jul
    • RE: MySQL ManualCraig Vincent25 Jul
      • Re: MySQL ManualErich L. Markert25 Jul
  • Re: MySQL ManualJohn Cichy25 Jul
  • Re: MySQL ManualBud Rogers25 Jul