当前位置:网站首页>Oracle encapsulates restful interfaces into views
Oracle encapsulates restful interfaces into views
2022-08-05 01:29:00 【Yin time】
oracleThe environment sometimes requires access to third-party distributionswebservice接口,Sometimes we have a whim,It would be nice to have access to these interfaces as if it were a local table,The following is the implementation method
数据示例
The following is a simple instance returned by an interface
{
"code": 200,
"data": [
{
"parent": "B01",
"name": "xxxxx",
"code": "B0101",
"enable_flag": "Y",
"los_date": ""
},
{
"parent": "B0101",
"name": "gggggggggg",
"code": "B010105",
"enable_flag": "Y",
"los_date": ""
}
]
}
具体实现
这里用到了两个工具:oracle apex 和 三方开源库 pljson,轻松实现
CREATE OR REPLACE VIEW XXXXX_V AS
SELECT json.status_code,
budget_dept_code,
budget_dept_name,
parent_code,
enable_flag,
end_active_date
FROM TABLE(pljson_table.json_table(apex_web_service.make_rest_request(p_url => 'https://blog.csdn.net/x6_9x',
p_http_method => 'GET',
p_wallet_path => xxx_ysx_yyds.get_wallet_path,
p_wallet_pwd => xxx_ysx_yyds.get_wallet_pwd),
pljson_varray('code',
'data[*].code',
'data[*].name',
'data[*].parent',
'data[*].enable_flag',
'data[*].los_date'),
pljson_varray('status_code',
'budget_dept_code',
'budget_dept_name',
'parent_code',
'enable_flag',
'end_active_date'),
table_mode => 'nested')) json
ORDER BY 2;
If it is to be consumedhttps接口,则需要配置oracleWallet import certificate,Interfaces with parameters are also supported here,可以把参数放到where条件中,具体可以参考apex_web_service.make_rest_request的用法
This is achieved like writingsql一样来访问webservice数据
边栏推荐
- 【Unity入门计划】2D游戏中遮挡问题的处理方法&伪透视
- 4. PCIe 接口时序
- 金仓数据库 KingbaseES V8 GIS数据迁移方案(3. 基于ArcGIS平台的数据迁移到KES)
- GCC:编译时库路径和运行时库路径
- MBps与Mbps区别
- AI+PROTAC|dx/tx完成500万美元种子轮融资
- OPENWIFI实践1:下载并编译SDRPi的HDL源码
- [Redis] Redis installation under Linux
- Use of pytorch: Convolutional Neural Network Module
- Getting Started with Kubernetes Networking
猜你喜欢
随机推荐
蓝牙Mesh系统开发五 ble mesh设备增加与移除
Jin Jiu Yin Shi Interview and Job-hopping Season; Are You Ready?
VOC格式数据集转COCO格式数据集
GCC: Shield dependencies between dynamic libraries
LiveVideoStackCon 2022 Shanghai Station opens tomorrow!
CNI (Container Network Plugin)
安装oracle11的时候为什么会报这个问题
2021年11月网络规划设计师上午题知识点(上)
行业现状?互联网公司为什么宁愿花20k招人,也不愿涨薪留住老员工~
Knowledge Points for Network Planning Designers' Morning Questions in November 2021 (Part 1)
Day Fourteen & Postman
KingbaseES V8 GIS数据迁移方案(2. Kingbase GIS能力介绍)
快速批量修改VOC格式数据集标签的文件名,即快速批量修改.xml文件名
第十四天&postman
[Machine Learning] 21-day Challenge Study Notes (2)
tcp中的三次握手与四次挥手
习题:选择结构(一)
主库预警日志报错ORA-00270
【PyQT5 绑定函数的传参】
Getting Started with Kubernetes Networking









