uralmaza...@pop3.ru wrote:
> sqlite3_open_v2( "testdat", &sqlDB, SQLITE_OPEN_READWRITE |
> SQLITE_OPEN_CREATE, NULL );
> sqlite3_prepare_v2( sqlDB, "SELECT b FROM whee WHERE a='bing';", -1,
> &sqlStat, NULL );
> sqlite3_step( sqlStat );
> const unsigned char *testValue = sqlite3_column_text( sqlStat, 0 );
>
> both a and b are varchar(20)s
>
> calling the query from the command-line tool returns the proper
> result "bang", however, running this code the value testValue shows
> up as ""

Shows up where? How do you examine the string?

Are you examining testValue immediately after sqlite3_column_text call? 
sqlite3_column_text returns a pointer to an internal buffer that may be 
reused by many other calls. If you need to keep the string around for 
later use, you must make a copy of it right after sqlite3_column_text.

Igor Tandetnik



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

Reply via email to