Can I determine the collation of a text argument to a function?

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

Can I determine the collation of a text argument to a function?

Jens Alfke-2
Is it possible for a user-defined function to determine the collation associated with its argument(s)? I'm implementing some custom string matching/comparison functions, and I want their case-sensitivity to depend on the collation of the first argument (the LHS).

I’ve searched sqlite3.h for “collate” and “collation" but didn’t find anything that looks relevant.

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can I determine the collation of a text argument to a function?

Richard Hipp-3
On 11/8/17, Jens Alfke <[hidden email]> wrote:
> Is it possible for a user-defined function to determine the collation
> associated with its argument(s)? I'm implementing some custom string
> matching/comparison functions, and I want their case-sensitivity to depend
> on the collation of the first argument (the LHS).

It is not currently possible for a UDF to find the collation
associated with its arguments.

Some built-in functions (ex: min() and max()) do this.  But they do so
using internal APIs and with help from the query planner.  The
capability is not available to ordinary UDFs.

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