Hi,
I have this code that fails always with the error output next:
=====
zSql= "SELECT r.name, s.content FROM resource AS r, static AS s WHERE (r.ids
= s.ids AND r.name = ?);";
stmt = NULL;
rc = sqlite3_prepare_v2(db, zSql, strlen(zSql), &stmt, NULL);
if ( rc != SQLITE_OK ){
dprintf( log, "Error on query: %s\n", sqlite3_errmsg(db));
dprintf( log, "Query : %s\n", zSql);
dprintf( log, " at %s %d:\n", __func__, __LINE__);
exit(1);
=====
Error on query: out of memory
Query : SELECT r.nombre, s.content FROM resource AS r, static AS s WHERE (r.ids
= s.ids AND r.nombre = ?);
at process_request 66:
=====
The tables schema are:
"CREATE TABLE IF NOT EXISTS resource(\n"
" rid INTEGER PRIMARY KEY NOT NULL,\n" // Resource ID
" type INTEGER NOT NULL,\n" // Type of resource
(music,video,+18)
" ids INTEGER,\n" // FK Static Resource ID (if
applicable)
" sys INTEGER DEFAULT 0,\n" // Is a system file (do not
delete)
" replicated INTEGER DEFAULT 0,\n" // Is resource replicated
somewhere (and safe)
" nombre TEXT NOT NULL,\n" // Resource name (filename or
appropiate)
" path TEXT\n" // Path to resource
");
and
"CREATE TABLE IF NOT EXISTS static(\n"
" ids INTEGER PRIMARY KEY,\n" // Static resource ID
" desc TEXT,\n" // Description
" content BLOB\n" // Main content
");\n"
I don't know why I get an Out of memory preparing the query. Vars are
initialized, db points to an open sqlite3 db, and stmt is the first time used
int the code. I use a similar code on other projects abd works with no
problems.
Any clue?
Thanks
--- ---
Eduardo Morras <[email protected]>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users