当前位置:网站首页>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数据
边栏推荐
- 超越YOLO5-Face | YOLO-FaceV2正式开源Trick+学术点拉满
- 第十一章 开关级建模
- VOC格式数据集转COCO格式数据集
- 软件测试技术之最有效的七大性能测试技术
- JVM类加载简介
- Bit rate vs. resolution, which one is more important?
- Day Fourteen & Postman
- Object.defineProperty实时监听数据变化并更新页面
- Activity Recommendation | Kuaishou StreamLake Brand Launch Conference, witness together on August 10!
- 3. pcie.v file
猜你喜欢
随机推荐
GCC:头文件和库文件的路径
【TA-霜狼_may-《百人计划》】图形4.3 实时阴影介绍
After the staged testing is complete, have you performed defect analysis?
Difference between MBps and Mbps
Helm Chart
How DHCP works
5.PCIe官方示例
二叉树[全解](C语言)
MongoDB construction and basic operations
接口自动化测试框架postman tests常用方法
JZ搜索引擎solr研究-从数据库创建索引
Use of pytorch: Convolutional Neural Network Module
CNI (Container Network Plugin)
DHCP的工作过程
工具类总结
Matlab uses plotting method for data simulation and simulation
1349. 参加考试的最大学生数 状态压缩
安装oracle11的时候为什么会报这个问题
ExcelPatternTool: Excel table-database mutual import tool
Methods commonly used interface automation test framework postman tests

![[Machine Learning] 21-day Challenge Study Notes (2)](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)


![[Redis] Redis installation under Linux](/img/84/7791a87ff976be15b455f6ddc05bf2.png)




