当前位置:网站首页>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数据
边栏推荐
- 【TA-霜狼_may-《百人计划》】图形4.3 实时阴影介绍
- 超越YOLO5-Face | YOLO-FaceV2正式开源Trick+学术点拉满
- 行业现状?互联网公司为什么宁愿花20k招人,也不愿涨薪留住老员工~
- (17) 51 MCU - AD/DA conversion
- XMjs跨域问题解决
- GCC:编译时库路径和运行时库路径
- 详细全面的postman接口测试实战教程
- 执掌图表
- ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionExcep
- If capturable=False, state_steps should not be CUDA tensors
猜你喜欢

Why is this problem reported when installing oracle11

Method Overriding and Object Class

ExcelPatternTool: Excel表格-数据库互导工具

深度学习原理学习小结 - Self-Attention/Transformer

LiveVideoStackCon 2022 上海站明日开幕!

迅睿cms网站搬迁换了服务器后网站不能正常显示
![Binary tree [full solution] (C language)](/img/4d/2d81dc75433c23c5ba6b31453396f0.png)
Binary tree [full solution] (C language)

【机器学习】21天挑战赛学习笔记(二)

Helm Chart

【Unity入门计划】2D游戏中遮挡问题的处理方法&伪透视
随机推荐
面试汇总:为何大厂面试官总问 Framework 的底层原理?
JZ搜索引擎solr研究-从数据库创建索引
Matlab uses plotting method for data simulation and simulation
EBS利用虚拟列及hint 提示优化sql案例一则
张驰咨询:揭晓六西格玛管理(6 Sigma)长盛不衰的秘密
DDOS攻击真的是无解吗?不!
如何用 Solidity 创建一个“Hello World”智能合约
ExcelPatternTool: Excel表格-数据库互导工具
A new technical director, who calls DDD a senior, is convinced
蓝牙Mesh系统开发四 ble mesh网关节点管理
CNI (Container Network Plugin)
EL定时刷新页面中的皕杰报表实例
缺陷检测(图像处理部分)
FSAWS 的全球基础设施和网络
手把手基于YOLOv5定制实现FacePose之《YOLO结构解读、YOLO数据格式转换、YOLO过程修改》
Jin Jiu Yin Shi Interview and Job-hopping Season; Are You Ready?
The use of pytorch: temperature prediction using neural networks
GCC:屏蔽动态库之间的依赖
【Word】Word公式导出PDF后出现井号括号#()错误
Is DDOS attack really unsolvable?Do not!