Not 100% sure I follow what you mean to achieve, but would:

Select tbl, CAST(BlobAsText(sample) AS TEXT) AS SampleText from sqlite_stat4

work for you?

On 2017/08/30 1:20 PM, Bart Smissaert wrote:
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.
One 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
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

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

Reply via email to