From: Warren Young Date: October 26 2010 1:19pm Subject: Re: Problems with storein and template queries List-Archive: http://lists.mysql.com/plusplus/9095 Message-Id: MIME-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable On Oct 26, 2010, at 1:37 AM, Florian Feldbauer wrote: > In pricipal my code looks like that: Yes, I got that from your original post. I'm asking you to modify one = of the examples to show the symptom, because I've tried, and haven't = succeeded. Here's my diffs for tquery1: > Index: examples/tquery1.cpp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- examples/tquery1.cpp (revision 2679) > +++ examples/tquery1.cpp (working copy) > @@ -49,12 +49,14 @@ > // Build a template query to retrieve a stock item given = by > // item name. > mysqlpp::Query query =3D con.query( > - "select * from stock where item =3D = %0q"); > + "select * from %0 where item =3D %1q"); > query.parse(); > =20 > // Retrieve an item added by resetdb; it won't be there = if > // tquery* or ssqls3 is run since resetdb. > - mysqlpp::StoreQueryResult res1 =3D = query.store("N=FCrnberger Brats"); > + cout << "Q: " << query.str("stock", "N=FCrnberger = Brats") << endl; > + mysqlpp::StoreQueryResult res1 =3D query.store("stock", > + "N=FCrnberger Brats"); > if (res1.empty()) { > throw mysqlpp::BadQuery("UTF-8 bratwurst item = not found in " > "table, run resetdb"); That code runs just fine here. Try it on your system. If it fails = there, please post your system details: OS, CPU type, compiler vendor, = compiler version... My suggestion to use "%0q" for the table parameter is bogus, though. = You have to use backticks to quote a table name in SQL, not single = quotes as SQL requires for values. The template query mechanism doesn't = know how to do backticks, so you'd have to put them into the template = query string yourself if you needed them. I did that, too, and it also = works.=