当前位置:网站首页>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数据
边栏推荐
- Opencv - video frame skipping processing
- LiveVideoStackCon 2022 上海站明日开幕!
- 蓝牙Mesh系统开发五 ble mesh设备增加与移除
- 蓝牙Mesh系统开发四 ble mesh网关节点管理
- EBS利用虚拟列及hint 提示优化sql案例一则
- source program in assembly language
- oracle create tablespace
- day14--postman接口测试
- 【翻译】CNCF对OpenTracing项目的存档
- Are testing jobs so hard to find?I am 32 this year and I have been unemployed for 2 months. What should an older test engineer do next to support his family?
猜你喜欢
Jin Jiu Yin Shi Interview and Job-hopping Season; Are You Ready?
【Unity入门计划】2D游戏中遮挡问题的处理方法&伪透视
ExcelPatternTool: Excel table-database mutual import tool
MongoDB construction and basic operations
安装oracle11的时候为什么会报这个问题
JWT简单介绍
习题:选择结构(一)
Xunrui cms website cannot be displayed normally after relocation and server change
创意代码表白
The use of pytorch: temperature prediction using neural networks
随机推荐
The difference between a process in user mode and kernel mode [exclusive analysis]
LiveVideoStackCon 2022 Shanghai Station opens tomorrow!
MySQL学习
LiveVideoStackCon 2022 上海站明日开幕!
金九银十面试跳槽季;你准备好了吗?
Bit rate vs. resolution, which one is more important?
ora-01105 ora-03175
【翻译】CNCF对OpenTracing项目的存档
JVM类加载简介
How DHCP works
Creative code confession
Lattice PCIe Learning 1
Opencv——视频跳帧处理
Method Overriding and Object Class
【TA-霜狼_may-《百人计划》】图形4.3 实时阴影介绍
为什么他们选择和AI恋爱?
3. pcie.v 文件
第十一章 开关级建模
内存取证系列1
“配置”是把双刃剑,带你了解各种配置方法