如何创建SQLite中一个用户定义的函数?函数、定义、用户、SQLite

2023-09-12 00:10:22 作者:っ、我听你撕心裂肺De哭

我在开发Android的应用程序,我需要创建SQLite中的UDF。是否有可能在sqlite的创建?如果是如何做到这一点?

I am developing an application in android and I need to create an udf in sqlite. Is it possible to create it in sqlite? And if yes how to do this?

推荐答案

SQLite没有在甲骨文或MS SQL Server的方式做用户定义函数的支持。对于SQLite的,您必须创建在C / C ++的回调函数,并使用 sqlite3_create_function 调用挂钩函数了。

SQLite does not have support for user-defined functions in the way that Oracle or MS SQL Server does. For SQLite, you must create a callback function in C/C++ and hook the function up using the sqlite3_create_function call.

不幸的是,Android的SQLite的API不允许的 sqlite3_create_function 直接拨打电话通过Java。为了得到它的工作,你需要用的