当前位置:网站首页>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数据
边栏推荐
- [How to smash wool according to the music the couple listens to during the Qixi Festival] Does the background music affect the couple's choice of wine?
- 创意代码表白
- 【Unity入门计划】2D游戏中遮挡问题的处理方法&伪透视
- 刷爆朋友圈,Alibaba出品亿级并发设计速成笔记太香了
- oracle将restful接口封装到视图中
- Activity Recommendation | Kuaishou StreamLake Brand Launch Conference, witness together on August 10!
- 为什么他们选择和AI恋爱?
- torch.autograd.grad finds the second derivative
- ora-01105 ora-03175
- 第十一章 开关级建模
猜你喜欢

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

仅3w报价B站up主竟带来1200w播放!品牌高性价比B站投放标杆!

day14--postman接口测试

MongoDB construction and basic operations

【Word】Word公式导出PDF后出现井号括号#()错误

手把手基于YOLOv5定制实现FacePose之《YOLO结构解读、YOLO数据格式转换、YOLO过程修改》

张驰咨询:揭晓六西格玛管理(6 Sigma)长盛不衰的秘密

详细全面的postman接口测试实战教程

PCIe 核配置

### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionExcep
随机推荐
1349. 参加考试的最大学生数 状态压缩
pytorch的使用:卷积神经网络模块
硬实力和软实力,哪个对测试人来说更重要?
活动推荐 | 快手StreamLake品牌发布会,8月10日一起见证!
内存取证系列1
CMS建站流程
Use of pytorch: Convolutional Neural Network Module
AI+PROTAC|dx/tx完成500万美元种子轮融资
深度学习原理学习小结 - Self-Attention/Transformer
XMjs跨域问题解决
2021年11月网络规划设计师上午题知识点(上)
CNI (Container Network Plugin)
linux(centOs7)部署mysql(8.0.20)数据库
Bit rate vs. resolution, which one is more important?
3. pcie.v file
Exercise: Selecting a Structure (1)
Creative code confession
【TA-霜狼_may-《百人计划》】图形4.3 实时阴影介绍
Software Testing Interview Questions: What do test cases usually include?
LiveVideoStackCon 2022 Shanghai Station opens tomorrow!