Overview
Features
Download
Documentation
Community
Add-Ons & Services

Poco::Data::Session Can't create table?

Please post support and help requests here.

Poco::Data::Session Can't create table?

Postby hahaha » 27 Jun 2012, 09:14

I use this class as below:

Code: Select all
SQLite::Connector::registerConnector();
Session ses("SQLite", "partition_1.db");
std::string varcharStr="varchar(50)";
std::string colname="coll";
ses << "create table topic(:col,:varchar)",use(colname),use(varcharStr),now;


it does't work and throw a Poco::Data::SQLite::InvalidSQLStatementException: SQL Statement invalid or database missing exception!

may be session does't support create data table SQL?
hahaha
 
Posts: 16
Joined: 09 Nov 2010, 10:14

Re: Poco::Data::Session Can't create table?

Postby alex » 27 Jun 2012, 14:31

hahaha wrote:it does't work and throw a Poco::Data::SQLite::InvalidSQLStatementException: SQL Statement invalid or database missing exception!

Can't do binding like that with DDL SQL statements, you are seeing compile error from SQLite API. But even if you could, you still have a syntax error - there is no comma between column name and type.
alex
 
Posts: 1047
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron