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 <iostream>
@@ -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<stock> 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);