Hi,

I understand from reading http://www.sqlite.org/c3ref/value.html that 
there is a distinction between protected and unprotected value objects, 
and that some api interfaces, notably sqlite3_value*, require the former 
and others, notably sqlite3_column*, provide the latter.

What I would really like to be able to do would be to cache objects 
returned by sqlite3_column_value(...) and process them later, even after 
the statement that generated them is finalised, but certainly after 
sqlite3_step has been used to move onto another row.  I assume from the 
documentation that the returned value from sqlite3_column_value is only 
valid until the next sqlite3_step call.

I realise that I could cache them in their final form (e.g. as integer, 
string, whatever in some form of union or struct), but at the point the 
statement runs and the row is being read, it may not be fully determined 
what form the output might be -- e.g. in the database it might be stored 
as integer, but required as float or string, etc. and for this to be known 
much later.  Since sqlite provides such a useful means of "converting" 
types through the sqlite_value* functions, I would really like to be able 
to use these.

Looking through the documentation, I can't seem to find an api function 
that converts "unprotected" value to objects to "protected" ones. However, 
would it be possible to use sqlite3VdbeMemCopy to do this task?

Looking at the code behind sqlite3_column_value and sqlite3VbdeMemCopy, 
I'm not sure this is necessarily the correct way to do it since there is a 
difference between the way the former alters the MEM flags and how the 
latter checks them, and I wonder whether this might mean it won't do what 
I need (?).

Is there another function that is preferable?  Or... is it not possible at 
all?

Many thanks for any and all suggestions!

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

Reply via email to