1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
#include <sstream>
//...
std::ostringstream temp;
std::string command;
temp << "CREATE TABLE USER( ID INT NOT NULL, LET CHAR[1] NOT NULL,)";
command = temp.str();
rc = sqlite3_exec(db, command.c_str(), callback2, 0, &zErrMsg);
//...
temp.str("");
temp << "INSERT INTO USER (ID, LET) VALUES (" << id <<", '"<< letter <<"')";
command = temp.str();
rc = sqlite3_exec(db, command.c_str(), callback2, 0, &zErrMsg);
//...
temp.str("");
temp << "INSERT INTO USER3 (NAME, YEAR) VALUES ('" << name << "', " << year1 << ")";
command = temp.str();
rc = sqlite3_exec(db, command.c_str(), callback2, 0, &zErrMsg);
|