SELECT
XMLELEMENT (
DECODE ('RF', 'RF', 'Credit', 'Sale'), xmlattributes ('01234567' AS "id")
) AS Order
FROM
DUAL
当我运行上述查询时,我收到ORA-00917-missing coma
错误。
答案 0 :(得分:1)
不确定您要执行的操作,但如果您需要动态元素名称,则需要使用EVALNAME
SELECT
XMLELEMENT (
evalname(
DECODE ('RF', 'RF', 'Credit', 'Sale')),
xmlattributes ('01234567' AS "id")
).getstringval() AS "Order"
FROM
DUAL