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 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 string, or select one of a few >> different consts. >> >> But what your problem is really telling you is that those tables are >> actually all one big table. The thing you think of as a table name is >> really just another column. >> >> Simon. >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > > > Yeah, thanks, I've found another way to solve my problem.. this wasn't too > hard ^^.. > > But now I've got a new problem, again with this function.. > > > I've create a structure in a header file (called init_handle) that > contains the informations like sqlite3 *db // sqlite3_stmt *Stmt // ... > > And in a .c file I've made a function that prepare a command, but I obtain > an error.. > > > Here is the line : > > if( sqlite3_prepare_v2(init_handle.db, zSql_stmt[i][j], > strlen(zSql_stmt[i][j])+1, &init_handle.Stmt[i][j], init_handle.pzTail) != > SQLITE_OK ) > { > fprintf(stderr, "Can't prepare : %s\n", > sqlite3_errmsg(init_handle.db)); > sqlite3_close(init_handle.db); > exit(1); > } > > And the error says : > > Can't create table : table DHSS already exists > Can't prepare : near "create": syntax error > > Do I have made a syntax error? > -- View this message in context: http://old.nabble.com/Unknown-parameter-for-prepare_v2-tp31653746p31662807.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users