iPhone上的SQLite的用户定义功能

时间:2022-11-05 12:11:27

I'm working on the n'th application locating zip's. Everything works fine in PHP while I worked along the docu on OpenGeoDB. Now, I'm trying the implementation on the iPhone-SDK, but SQLite doesn't have the ACOS, SIN etc funcs. Can anybody point me to an example of how to expand the SQLite with userfunctions in order to use them in a select?

我正在开发第n个定位zip的应用程序。当我在OpenGeoDB上工作时,PHP中的一切都运行得很好。现在,我正在尝试iphone sdk的实现,但是SQLite没有ACOS、SIN等功能。有没有人可以告诉我如何使用userfunction扩展SQLite,以便在select中使用它们?

Any hints appreciated!

任何暗示感激!

Thanx and happy coding! Marcus

谢谢和编码快乐!马库斯

2 个解决方案

#1


2  

This one clears it up pretty nicely:

这个清理得很好:

http://www.thismuchiknow.co.uk/?p=71

http://www.thismuchiknow.co.uk/?p=71

#2


0  

sqlite3_create_function(database, "yourAwesome", 4, SQLITE_UTF8, NULL, &yourAwesomeFunc, NULL, NULL);

#1


2  

This one clears it up pretty nicely:

这个清理得很好:

http://www.thismuchiknow.co.uk/?p=71

http://www.thismuchiknow.co.uk/?p=71

#2


0  

sqlite3_create_function(database, "yourAwesome", 4, SQLITE_UTF8, NULL, &yourAwesomeFunc, NULL, NULL);