Friday, 15 June 2012

How to CREATE TEMP TABLE with SQLite -



How to CREATE TEMP TABLE with SQLite -

i trying create temporary table maintain getting open errors. g_maindb below main database. when creating temporary tables have utilize different database or something?

when run code, next error:

executesql: step failed: unable open database file

i have 2 threads open g_maindb thought since temporary tables not created in main database wouldn't have been problem?

can please provide me illustration of how create temporary table or tell me if there problem code using.. or indeed locking problem?

i have next code:

sprintf( g_txsql, "create temp table tempplaylist (seq integer primary key autoincrement, md5 varchar)" ); executesql( g_txsql ); ... bool executesql( char *pszsql ) { sqlite3_stmt *stmt; int rc; rc = sqlite3_prepare_v2( g_maindb, pszsql, -1, &stmt, null ); if( rc != sqlite_ok ) { logdebugf( "executesql: prepare failed: %s\n", sqlite3_errmsg( g_maindb ) ); homecoming false; } rc = sqlite3_step( stmt ); if( rc != sqlite_row && rc != sqlite_done ) { logdebugf( "executesql: step failed: %s\n", sqlite3_errmsg( g_maindb ) ); sqlite3_finalize( stmt ); homecoming false; } sqlite3_finalize( stmt ); homecoming true; }

sqlite table locking create-table temp

No comments:

Post a Comment