When Poco::Data creates an SQL statment and sends it to a database (like SQLite) is there anyway to see what SQL is generated? Say even before it is sent? For instance in the following code (similar to one of the Poco provided samples in version 1.6.1 Poco/Data/samples/TypeHandler/src/TypeHandler.cpp) is there anyway to see the generated SQL for the INSERT statement? Even if there is an InvalidSQLException thrown eventually?
using namespace Poco::Data::Keywords;
using Poco::Data::Session;
using Poco::Data::Statement;
int main() {
Person aperson("firstName", "lastName", 1234);
Poco::Data::SQLite::Connector::registerConnector();
Session session("SQLite", "sample.db");
session << "DROP TABLE IF EXISTS Person", now;
session << "CREATE TABLE Person (Name VARCHAR(30), LastName VARCHAR(30), ID INTEGER(10))", now;
session << "INSERT INTO Person VALUES (?,?,?)", use(aperson), now;
return 0;
}
Aucun commentaire:
Enregistrer un commentaire