连接到MySQL中的Web服务/API? [英] Connect to web-service/API in MySQL?
问题描述
我正在创建一个基于sql的过程,该过程可以
I'm creating a sql based procedure which can
- 接受表格
- 一次加载一个值
- 将变量发送到远程API
- 记录API的响应
- 将回复写到表格中以供以后查看
我已经成功实现了1,2和5.我希望可以通过某种方式选择要联系的地址,并让SQL也可以侦听响应.如果您有任何建议,请告诉我!
I have successfully implemented 1,2, and 5. I am hoping there may be some way of choosing an address to contact and for SQL to listen too for a response. Please let me know if you have any suggestions!
推荐答案
MySQL调用Web服务的唯一方法是通过自定义UDF.
The only way MySQL can call a webservice is through a custom UDF.
请参阅下面的链接,但是基本上您需要做的是构建一个C程序,该程序将使用变量作为参数调用远程Web服务API,通过UDF将响应返回到您的实际SQL,该SQL可以将结果插入到一张桌子.不过,这需要做很多工作,特别是如果您根本不熟悉C.
See the below link, but basically what you would need to do is build a C program that would call the remote webservice API with the variables as parameters, return the reponse via the UDF to your actual SQL which could insert the results to a table. This is quite a lot of work though, especially if you are not at all familiar with C.
http://www. codeguru.com/cpp/data/mfc_database/misc/article.php/c12615/MySQL-UDFs.htm
这篇关于连接到MySQL中的Web服务/API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!