Re: [sqlite] Unknown parameter for prepare_v2

2011-05-20 Thread Dev_lex
Forget my last post.. The error was that I didn't initialize pzTail to NULL... That's ok :) Dev_lex wrote: > > > Simon Slavin-3 wrote: >> >> >> On 19 May 2011, at 9:35am, Dev_lex wrote: >> >>> I need to prepare the statement before to know the name of the table, >>> but >>> I'll find an

Re: [sqlite] Unknown parameter for prepare_v2

2011-05-20 Thread Dev_lex
Simon Slavin-3 wrote: > > > On 19 May 2011, at 9:35am, Dev_lex wrote: > >> I need to prepare the statement before to know the name of the table, but >> I'll find an other way.. >>> I would like to do this : const char *zSql = "INSERT INTO ?(ID, MyData)

Re: [sqlite] Unknown parameter for prepare_v2

2011-05-19 Thread Simon Slavin
On 19 May 2011, at 9:35am, Dev_lex wrote: > I need to prepare the statement before to know the name of the table, but > I'll find an other way.. >> >>> >>> I would like to do this : >>> >>> const char *zSql = "INSERT INTO ?(ID, MyData) VALUES('1',?)"; Instead of using a const, use a C

Re: [sqlite] Unknown parameter for prepare_v2

2011-05-19 Thread Dev_lex
Oh ok.. Thanks a lot, I thought there was some way to do that.. I need to prepare the statement before to know the name of the table, but I'll find an other way.. Thanks ! Martin Engelschalk wrote: > > Hi, > > you cannot bind the name of a table. Bind variables only work for Values > in

Re: [sqlite] Unknown parameter for prepare_v2

2011-05-19 Thread Martin.Engelschalk
Hi, you cannot bind the name of a table. Bind variables only work for Values in the database, like you used in the VALUES('1', ?) - clause. Names of tables, columns or other items of the schema must be written in the sql statement. You will have to build your statement (using sprintf() or

[sqlite] Unknown parameter for prepare_v2

2011-05-19 Thread Dev_lex
Hello, I've a little question about sqlite3_prepare_v2 : I would like to do this : const char *zSql = "INSERT INTO ?(ID, MyData) VALUES('1',?)"; if(ppStmt) { sqlite3_bind_parameter_name(ppStmt, "atest"); sqlite3_bind_blob(ppStmt, 2, , sizeof(blob), SQLITE_TRANSIENT);