List:MySQL++« Previous MessageNext Message »
From:Rene Brunner Date:August 10 2006 8:40am
Subject:Prepared statements
View as plain text  
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
Thread
Prepared statementsRene Brunner10 Aug
  • Re: Prepared statementsWarren Young10 Aug
  • Re: Prepared statementsChris Frey10 Aug