> Then a bind the values to that statement and write it to the DB. That all 
> works except for the TEXT field "Name". I'm calling sqlite3_bind_text like 
> this:
> 
>       char *Name = "Something";       
>       sqlite3_bind_text(Stmt, 3, (const char*)Name, -1, SQLITE_STATIC);
> 
> And it return SQLITE_OK, however the value in the DB is NULL, or an empty 
> string. Certainly not the "Something" I pass in. All the integer fields are 
> written successfully so I know it's mostly working. The string is valid 
> utf-8, null terminated C-string.

It's possible that the char* variable is going out of scope before 
SQLite3 has a chance to commit the string data.  Try passing 
SQLITE_TRANSIENT to sqlite3_bind_text(), rather than STATIC.  This will 
cause SQLite to create a private copy of the string, ensuring that it 
isn't destroyed prematurely.

~Eric
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to