Joshua Angolano writes: > Can, you send insert statements through standard SQL, instead of using > special structures? Here is an example: > > > String loc; > loc="home"; > Query query = con.query(); > query << "insert into loacation (user_location) values('"<<loc<<"')"; > query.execute(); > > > Assuming of course that con is a type of Connection. > >
And what is wrong with this: query << "insert into %5:table values (%0q, %1q, %2, %3, %4q)"; query.parse(); // set up the template query I will use to insert the data. The // parse method call is important as it is what lets the query // know that this is a template and not a literal string query.def["table"] = "stock"; // This is setting the parameter named table to stock. query.execute ("Hamburger Buns", 56, 1.25, 1.1, "1998-04-26"); query.execute ("Hotdogs' Buns" ,65, 1.1 , 1.1, "1998-04-23"); query.execute ("Dinner Roles" , 75, .95, .97, "1998-05-25"); query.execute ("White Bread" , 87, 1.5, 1.75, "1998-09-04"); No specialized structs ... -- Regards, __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus <___/ www.mysql.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php