From: Warren Young Date: November 3 2010 4:54pm Subject: Re: Problems with storein and template queries List-Archive: http://lists.mysql.com/plusplus/9105 Message-Id: <4CD193BE.90008@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit On 10/27/2010 1:27 AM, Florian Feldbauer wrote: > > But using SSQLS and the storein() command, > it only works with one parameter, not with two. I still can't reproduce it. Are you using MySQL++ 3.1.0, or something older? Here are the diffs for the way I tested: Index: examples/tquery1.cpp =================================================================== --- examples/tquery1.cpp (revision 2680) +++ examples/tquery1.cpp (working copy) @@ -27,6 +27,7 @@ #include "cmdline.h" #include "printdata.h" +#include "stock.h" #include @@ -49,12 +50,13 @@ // Build a template query to retrieve a stock item given by // item name. mysqlpp::Query query = con.query( - "select * from stock where item = %0q"); + "select * from %0 where item = %1q"); query.parse(); // Retrieve an item added by resetdb; it won't be there if // tquery* or ssqls3 is run since resetdb. - mysqlpp::StoreQueryResult res1 = query.store("Nürnberger Brats"); + vector res1; + query.storein(res1, "stock", "Nürnberger Brats"); if (res1.empty()) { throw mysqlpp::BadQuery("UTF-8 bratwurst item not found in " "table, run resetdb"); @@ -66,7 +68,7 @@ query << "update stock set item = %0q where item = %1q"; query.parse(); mysqlpp::SimpleResult res2 = query.execute("Nuerenberger Bratwurst", - res1[0][0].c_str()); + res1[0].item); // Print the new table contents. print_stock_table(query);