当前位置:网站首页>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数据
边栏推荐
猜你喜欢

动态规划/背包问题总结/小结——01背包、完全背包

tcp中的三次握手与四次挥手

A new technical director, who calls DDD a senior, is convinced

JVM类加载简介

汇编语言之源程序

码率vs.分辨率,哪一个更重要?

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

快速批量修改VOC格式数据集标签的文件名,即快速批量修改.xml文件名

LiveVideoStackCon 2022 上海站明日开幕!

### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionExcep
随机推荐
MBps与Mbps区别
If capturable=False, state_steps should not be CUDA tensors
创意代码表白
硬实力和软实力,哪个对测试人来说更重要?
GC高德坐标和百度坐标转换
如何用 Solidity 创建一个“Hello World”智能合约
LiveVideoStackCon 2022 上海站明日开幕!
[Redis] Redis installation under Linux
Creative code confession
第09章 性能分析工具的使用【2.索引及调优篇】【MySQL高级】
一文看懂推荐系统:召回06:双塔模型——模型结构、训练方法,召回模型是后期融合特征,排序模型是前期融合特征
为什么他们选择和AI恋爱?
torch.autograd.grad求二阶导数
C语言基础知识 -- 指针
Exercise: Selecting a Structure (1)
EBS利用虚拟列及hint 提示优化sql案例一则
3. pcie.v file
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionExcep
GCC:编译时库路径和运行时库路径
ExcelPatternTool: Excel table-database mutual import tool