Determine SQLite data type after UDF conversion

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Determine SQLite data type after UDF conversion

Bart Smissaert
Say I have a query like this:
Select tbl, BlobAsText(sample) from sqlite_stat4
Where BlobAsText is a UDF that takes a blob and converts it to a string.
Now I need to know that the second column of the output needs to be dealt
with as text.
Is there any SQLite API that can help me with this?
sqlite3_column_type and sqlite3_column_decltype can't tell me this
information.
I could work it out by parsing the SQL or by looking at
sqlite3_column_name, but having the UDF name in the column_name doesn't
necessarily mean that the output of that column is text.
On way to solve this would be to put this information in the field alias,
eg:
Select tbl, BlobAsText(sample) as BLOB_IS_TEXT from sqlite_stat4, but that
is quite restrictive.
Any suggestions what the best way is to solve this problem?
I do have full control of the application code (the SQLite wrapper).

RBS
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users