On Tue, Feb 26, 2013 at 2:31 PM, Clemens Ladisch <[email protected]> wrote:
> ... 'somedata/' || CAST(x'F48FBFBF' AS TEXT)
>
Great trick! But it hardly qualifies as user friendly though, no?
For our app, I added a chr() SQL function that take an arbitrary number of
integers and UTF-8 encodes them:
register_function(-1, "chr", codepoint_to_utf8);
so the above becomes
... 'somedata/' || chr(1114111)
Of course, the fact that it's a decimal code-point number is not ideal
since less expressive than
... 'somedata/' || chr(0x10FFFF)
but hexa-literals are not supported in SQL it seems (I tried just SQLite
and Oracle).
My $0.02 is that such a chr() function could/should be built-in to SQLite.
--DD
PS: Something else that should also be part of SQLite built-in is the
optimization that col LIKE 'prefix%' queries should implicitly try to use
an index on col. I suspect it may be more difficult than I expect because
of collation, but absent custom collations, I wish that optimization was
available.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users