7 messages in com.mysql.lists.plusplusRe: interesting problem| From | Sent On | Attachments |
|---|---|---|
| JD Smith | 23 Mar 2004 20:06 | |
| Sinisa Milivojevic | 24 Mar 2004 04:07 | |
| Jae Joo | 24 Mar 2004 07:26 | |
| JD Smith | 24 Mar 2004 07:37 | |
| JD Smith | 24 Mar 2004 07:46 | |
| Sinisa Milivojevic | 25 Mar 2004 03:40 | |
| Sinisa Milivojevic | 25 Mar 2004 03:42 |
| Subject: | Re: interesting problem![]() |
|---|---|
| From: | JD Smith (jdsm...@letu.edu) |
| Date: | 03/24/2004 07:46:29 AM |
| List: | com.mysql.lists.plusplus |
Also, is there any particular reas I cannot seem to make version 1.7.1 use exceptions? I'm doing it as it shows in the tutorial example code at mysql.com in the document. Thinking that maybe it is done differently in v1.7.1 than in 1.7.9...
- JD
----- Original Message ----- From: "Jae Joo" <jaey...@yahoo.com> To: <sin...@beotel.yu>; "JD Smith" <jdsm...@letu.edu> Cc: <plus...@lists.mysql.com> Sent: Wednesday, March 24, 2004 9:26 AM Subject: Re: interesting problem
This is the method I am using.
Query (con, false); ostrstream str; str<< "UPDATE material SET ar_unit = '" << argument << " * ar_pct / 100' WHERE category = @tempcat"<<ends; query.exec(str.buf());
Jae Joo www.jaesolution.com
--- Sinisa Milivojevic <sin...@mysql.com> wrote:
JD Smith wrote:
Well, I finally got everything working again so I
went to start making modifications for the next stage of implementation of my project. Below is an example pulled from one of a few functions that use similar constructs:
query << "UPDATE material SET ar_unit = '" <<
argument << "' WHERE type = '" << ch->desc->edit_string << "'";
query.execute();
query << "SELECT @tempcat:=category FROM
material_categories WHERE category_standard = '" << ch->desc->edit_string << "'";
query.execute();
query << "UPDATE material SET ar_unit = '" <<
argument << " * ar_pct / 100' WHERE category = @tempcat";
query.execute();
It /always/ crashes on the third query even if I
were to make it the same as the first query.. This is making absolutely no sense. I have verified the data is correct in the table and I typed all of my query code into the mysql terminal to verify that it is correct. Guess what? It returns the expected values. Anyone have any ideas?
- JD
No, the above is not correct method of doing it.
You should run them like this (all three of those):
query.exec ("UPDATE material SET ar_unit = '" << argument << " * ar_pct / 100' WHERE category = @tempcat");
--
Sincerely,
-- For technical support contracts, go to https://order.mysql.com/?ref=msmi __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <sin...@mysql.com> / /|_/ / // /\ \/ /_/ / /__ 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=jaey...@yahoo.com
__________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html




