运行以下查询时出错
select xt.IssueDate, xt.SequenceNumber from xml_tab x ,
XMLTABLE('/EmployeeInfo'
PASSING x.xml_data COLUMNS
"IssueDate" varchar2(10) path '@IssueDate',
"SequenceNumber" integer path '@SequenceNumber'
) xt;
错误我正在
ORA-00904:“XT”。“SEQUENCENUMBER”:标识符无效 00904. 00000 - “%s:无效标识符” *原因:
*动作:行错误:114列:22
答案 0 :(得分:0)
你正在混合quoted and non-quoted identifiers。 XMLTable调用中的columns
子句定义了SQL类型的名称,而不是XML类型的名称。
你可以引用两个:
select xt."IssueDate", xt."SequenceNumber" from xml_tab x ,
XMLTABLE('/EmployeeInfo'
PASSING x.xml_data COLUMNS
"IssueDate" varchar2(10) path '@IssueDate',
"SequenceNumber" integer path '@SequenceNumber'
) xt;
或最好不要引用:
select xt.IssueDate, xt.SequenceNumber from xml_tab x ,
XMLTABLE('/EmployeeInfo'
PASSING x.xml_data COLUMNS
IssueDate varchar2(10) path '@IssueDate',
SequenceNumber integer path '@SequenceNumber'
) xt;