作者:许婉玟秀贤 | 来源:互联网 | 2024-09-26 11:46
嗨,汤姆,
我正在尝试解析附加的xml字段并获取订户编号-4811111111。我尝试了几个选项,但ORA-06502出现错误: PL/SQL: numeric或value error。你能帮忙解析这个吗?
增加了查询和错误
----- 查询 ------------
select
cast(extract(xmltype(t.response), '//newSubscriberNumber/text()','xmlns="http://csi.abc.com/CSI/Namespaces/Container/Public/ChangeSubscriberNumberResponse.xsd" xmlns:ns2="http://csi.abc.com/CSI/Namespaces/Types/Public/abc.xsd"') as varchar2(100))
as fault_string
from table t;
ORA-06502 PL/SQL: numeric or value error
ORA-06512 at "sys.xmltype"
------ 下面的xml -----
4811111111
NBI
0
Success
你到底是如何存储XML的?
以下对我有用:
create table t (
c1 varchar2(1000)
);
insert into t values ( '
4811111111
NBI
0
Success
'
);
commit;
select cast (
extract (
xmltype ( t.c1 ),
'//newSubscriberNumber/text()',
'xmlns="http://csi.abc.com/CSI/Namespaces/Container/Public/ChangeSubscriberNumberResponse.xsd" xmlns:ns2="http://csi.abc.com/CSI/Namespaces/Types/Public/abc.xsd"'
)
as varchar2(100)
) as fault_string
from t;
FAULT_STRING
4811111111