SELECT XMLELEMENT("dummy",NULL) as xml_1 FROM dual
输出为< dummy>< / dummy>
如何强制返回< dummy /> ?
xmltype构造函数虽然会将其转换为11g(10g中的提取函数也是如此,但不是11g).
sql> SELECT xmltype(XMLELEMENT("dummy",NULL).getclobval()) as xml_1 from dual; XML_1 -------------------------------------------------------------------------------- <dummy/>