【发布时间】:2020-11-13 01:16:27
【问题描述】:
示例 JSON:
[
{
"term-id": "BA000000",
"bank-id": "111",
"location": "Poslovalnica banke",
"address": "Cankarjeva ulica 2",
"city": "Ljubljana",
"post-code": "1000",
"printer": "true",
"deposit": "false",
"accessible": "true",
"cards": "DECPVR",
"special-payments": "false",
"BNA": "false",
"transaction-receipt": "true",
"latitude": 46.051671,
"longitude": 14.505122
}
]
我正在尝试使用 pljson:
declare
w_req t_http_request := t_http_request();
w_res t_http_response;
w_vrni clob;
w_json pljson;
w_jsonValue pljson_value;
w_jsonList pljson_list;
w_test varchar2(100);
begin
w_req.url := 'https://api.bankart.si/psd2/hub/v1/' || 'ATMList';
w_req.add_header('x-ibm-client-id', 'client-id');
w_res := https_client.doGet (w_req, 'DB');
w_vrni := hibis_util.convertBlobToClob(w_res.content_blob,'AL32UTF8');
w_jsonList := pljson_list(w_vrni);
if w_jsonList is not null and w_jsonList.count > 0 then
for i in 1..w_jsonList.count loop
w_json := pljson(w_jsonList.get(i));
w_jsonValue := w_json.get('term-id');
w_test := w_jsonValue.get_string;
dopl(w_test);
end loop;
end if;
end;
我可以提取,我不知道这个 JSON 中的位置或地址值,但是当我想提取元素 term-id 或 bank-id 时,我收到错误 PL/SQL ORA-30625: method dispatch不允许使用 NULL SELF 参数。也许是因为“-”之间的符号?
有人有想法吗?谢谢。
【问题讨论】:
-
您正试图在一个为空的对象变量上调用方法。我怀疑它可能是 w_jsonValue 变量。