Android系统。它是更多钞票来编写自定义函数的C / C ++,并用它在SQL查询? [英] Android. Is it posible to write custom function on C/C++ and use it in SQL query?

查看:156
本文介绍了Android系统。它是更多钞票来编写自定义函数的C / C ++,并用它在SQL查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sqlite3的不支持存储过程。它是更多钞票上写上C / C ++自定义函数,并用它在SQL查询?

SQLite3 doesn't support stored procedures. Is it posible to write custom function on C/C++ and use it in SQL query?

这样的东西

SELECT * FROM table WHERE CUST_FUNCTION(name1, name2) = 1

SELECT CUST_FUNCTION(name1, name2) FROM table

也许你有一些很好的例子,如何做到这一点。

Maybe you have some good example how to do that.

推荐答案

可悲的是,它似乎你不能。

Sadly, it appears you cannot.

我一直在寻找这样的事情来计算从一个SQLite查询中距离 - 它有时提到这样做的方法

I was looking at something like this for calculating distance from within a sqlite query - it was sometimes mentioned as a method for doing this.

源码不支持这样的事情,所以文件和其他参考文献将表明,这是可能的。 然而的,看着各种渠道后,我得出的结论是,虽然可以在使用SQLite(如iPhone,我相信)几个地方做的,你不能做到这一点在Android的SQLite的(至少我没有发现任何人能够做到这一点的方式在Android的)。

sqlite does support something like this, so documentation and other references will suggest that this is possible. However, after looking at various sources, I came to the conclusion that, while you can do it in several places that use sqlite (like iPhone I believe), you can't do it in Android's sqlite (at least I didn't find anyone able to do this way in Android).

下面有几个,我发现这表明它不可能在Android和不幸的是,我找不到任何的反链接。但我很想找到我错了,这个...

Here are a couple of links that I had found suggesting it wasn't possible in Android and unfortunately I couldn't find any counterexamples. But I'd love to find I'm wrong about this ...

<一个href="http://stackoverflow.com/questions/2034348/android-sqlite-sort-on-calculated-column-co-ordinates-distance/2034363#2034363">Android在计算列(坐标距离)

      
  • 在您所描述的方法似乎并不适用于Android的,这不能用sqlite3_create_function() - CommonsWare年01月09 '10 19:00
  •   

<一个href="http://stackoverflow.com/questions/2352320/sqlite-on-android-how-to-create-a-sqlite-dist-db-function-to-be-used-in-the-ap/2352389#2352389">Sqlite在Android上:如何创建一个SQLite数据库测距的功能 - 使用经纬度用于应用程序的距离计算,长

      
  • org.sqlite不是机器人的API,所以这是不相关的。 - hackbod 3月1日'10在4:59   1
  •   
  • 您是正确的,org.sqlite不是一个Android API。但是,你可以用它来实现内容提供商,做什么他问。 - 约书亚·史密斯3月1日'10在12:39
  •   
  • 其实,我是相当怀疑在您链接到内容提供商的答案中概述的方式。 org.sqlite是不是在Android的,目前还不清楚是否存在一个org.sqlite实施,将工作在演唱会与Android的SQLite的环境。 - Pentium10 6月27日'10在9:12
  •   
  • org.sqlite is not an Android API, so that is not relevant. – hackbod Mar 1 '10 at 4:59 1
  • You are correct, org.sqlite is not an Android API. However, you can use it to implement a Content Provider that does what he asked. – Joshua Smith Mar 1 '10 at 12:39
  • Actually, I'm rather skeptical on the approach outlined in the content provider answer you link to. org.sqlite is not in Android, and it is unclear if there exists an org.sqlite implementation that will work in concert with Android's SQLite environment. – Pentium10 Jun 27 '10 at 9:12

这篇关于Android系统。它是更多钞票来编写自定义函数的C / C ++,并用它在SQL查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆