我有以下pl/sql
块,我将VARCHAR2
类型转换为json。当VARCHAR2
类型由/
等特殊字符组成时,我遇到一个问题,json解析器抛出异常:
DECLARE
oj json := json('{a/b:xy})');
BEGIN
dbms_output.put_line(oj.TO_CHAR());
END;`enter code here`
ORA-20100: JSON Scanner exception @ line: 1 column: 5 - Unexpected char: /
ORA-06512: at "PARIS.JSON_PARSER", line 87
ORA-06512: at "PARIS.JSON_PARSER", line 447
ORA-06512: at "PARIS.JSON_PARSER", line 646
ORA-06512: at "PARIS.JSON", line 13
ORA-06512: at line 2
可以处理吗?
答案 0 :(得分:1)
您的json无法解析
尝试发送有效的JSON,它将起作用
json('{"a/b": "xy"}')