5 messages in com.mysql.lists.plusplusYou have an erro in your sql sintax -...
FromSent OnAttachments
nelson evangelista19 Mar 2004 10:46 
Sinisa Milivojevic20 Mar 2004 04:08 
Tommy Tang23 Mar 2004 04:33 
Jae Joo23 Mar 2004 06:15 
Sinisa Milivojevic23 Mar 2004 06:28 
Subject:You have an erro in your sql sintax - mysql 4.0.18 msvc++ 6.0
From:nelson evangelista (nels@brturbo.com)
Date:03/19/2004 10:46:43 AM
List:com.mysql.lists.plusplus

#include <iostream> #include <vector> #include <sqlplus.hh> #include <custom.hh>

sql_create_5 (stock, 1, 5, string, item, int, num, double, weight, double, price, Date, sdate)

int main() { try { // its in one big try block

Connection con(use_exceptions); con.connect("mysql_cpp_data","localhost","root"); Query query = con.query();

stock row;

row.set("Cachorro Hot Dogs",100,1.5,1.75,"1998-09-25"); // populate stock

query.insert(row); // form the query to insert the row // the table name is the name of the struct by default

cout << "Query : " << query.preview() << endl; // show the query about to be executed

query.execute(); // execute a query that does not return a result set

return 0;

} catch (BadQuery er){ // handle any connection // or query errors that may come up cerr << "Error_1: " << er.error << endl; return -1;

} catch (BadConversion er) { cerr << "Error_2: Tried to convert \"" << er.data << "\" to a \"" << er.type_name << "\"." << endl; return -1; } }