当前位置:网站首页>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数据
边栏推荐
- 蓝牙Mesh系统开发五 ble mesh设备增加与移除
- FSAWS 的全球基础设施和网络
- 方法重写与Object类
- day14--postman interface test
- 【翻译】CNCF对OpenTracing项目的存档
- ORA-00257
- 金九银十面试跳槽季;你准备好了吗?
- Xunrui cms website cannot be displayed normally after relocation and server change
- sqlite--nested exception is org.apache.ibatis.exceptions.PersistenceException:
- JUC thread pool (1): FutureTask use
猜你喜欢
随机推荐
GCC:头文件和库文件的路径
执掌图表
oracle create tablespace
GCC: Shield dependencies between dynamic libraries
Use of pytorch: Convolutional Neural Network Module
Interview summary: Why do interviewers in large factories always ask about the underlying principles of Framework?
Xunrui cms website cannot be displayed normally after relocation and server change
深度学习训练前快速批量修改数据集中的图片名
Creative code confession
二叉树[全解](C语言)
跨域解决方案
Knowledge Points for Network Planning Designers' Morning Questions in November 2021 (Part 1)
主库预警日志报错ORA-00270
A new technical director, who calls DDD a senior, is convinced
活动推荐 | 快手StreamLake品牌发布会,8月10日一起见证!
The method of freely controlling concurrency in the sync package in GO
FSAWS 的全球基础设施和网络
1349. 参加考试的最大学生数 状态压缩
Three handshake and four wave in tcp
LiveVideoStackCon 2022 上海站明日开幕!









