Hi,

maybe I should ask this on sqlite-dev, but I thought I'd try it here first.

Is there a (relatively easy) way to hack up a function call that would
just retrieve one record by it's oid (primary integer key), and return it
in a form that would allow using the sqlite3_columm() functions?

Something along the lines of:

   sqlite3_prepare(db, "select * from company where id = 1", -1, &stmt, NULL);
   rc = sqlite3_get_byoid(stmt, oid);
   id = sqlite3_column_int(stmt, 0);

or even:

   sqlite3_prepare(db, "select * from company where id = 1", -1, &stmt, NULL); 
// dummy sql statement
   rc = sqlite3_get_byoid(stmt, "company", oid);  // because the real table 
name is specified here
   id = sqlite3_column_int(stmt, "name");  // some column name in the company 
table

or maybe in another form that lets me easily and quickly get out the column 
values

or should I try to reach out into btree directly and parse the data directly?

I need to speed up record retrieval from a in-memory database, and I know
beforehand that 99% of my queries involve retrieving one record by primary
integer key.


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

Reply via email to