Prepared statements 2006-08-10 - By Rene Brunner
Back Hello,
can anybody help me with mysql++ and prepared statements? Correspond the example in the following code a prepared statement?
mysqlpp::Query query = con.query();
query << "create table stock (item char(20) not null, " "num bigint, weight double, price double, sdate date)"; query.execute();
query << "insert into stock values (%0q, %1q, %2, %3, %4q)"; query.parse();
query.execute("N?rnberger Brats", 92, 1.5, 8.79, "2005-03-10"); query.execute("Pickle Relish", 87, 1.5, 1.75, "1998-09-04"); query.execute("Hot Mustard", 75, .95, .97, "1998-05-25"); query.execute("Hotdog Buns", 65, 1.1, 1.1, "1998-04-23");
Is the following insert faster than the previous one?
query << "insert into stock values " << "(N?rnberger Brats', 92, 1.5, 8.79, '2005-03-10')," << "('Pickle Relish', 87, 1.5, 1.75, '1998-09-04')," << "('Hot Mustard', 75, .95, .97, '1998-05-25')," << "('Hotdog Buns', 65, 1.1, 1.1, '1998-04-23')"; query.execute();
Regards, Rene
-- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=mysql@(protected)
|
|