Igor Tandetnik wrote:
Martin Pelletier <mp-PCTmRokFnwWw5LPnMra/[EMAIL PROTECTED]> wrote:
 Is there a similar function that
would place the result of a query in memory just like SQL3_get_table but
their stored type (integer, float, etc), with perhaps a header to indicate
what type the data should be read as?

With SQLite's manifest data type system, this is, in general, impossible. Consider:

select id, (case when id%2 then 'odd' else 0 end) as tricky
from mytable;

In the "tricky" column, you would have some rows with string data and some with an integer.

See sqlite3_prepare[_v2], sqlite3_step, sqlite3_finalize, sqlite3_column_*
I took a look at those functions. Interestingly enough, there seems to be something close to what I would want in the sqlite3_column_* functions. I understand that in a calculated field (especially with "case when then else") the type would be dependent of the data parsed. A MAX() function performed on a STRING field would return 0, though. There could be a way to report what type an entire column contains, or else to drive what it should contain. That way, if "tricky" is specified as int, all "odd's" would be forced to some default value. If "tricky" is specified as text, all "0's" would be put in text.

Also, could this data be
arrayed? It would seem that reading an array from memory of length n would be
faster than reading separately n pointers.

I don't understand this question, sorry.

Igor Tandetnik
This is less important, but sqlite3_get_table (through sqlite3_step) writes the result of a query as rows, not columns. I was thinking there could be a way to perhaps reorder the pointers, to have queries written as columns, i.e. as arrays of integers, for example.

I am simply asking if all this exists, either naturally or as a third-party add-on of some kind.

Thanks.

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to