2
我的程序甲骨文的Xml生成節點空
SELECT dbms_xmlgen.getxml('select * from '||i_tablename) into xml_data from dual;
doc := DBMS_XMLDOM.NewDOMDocument(xml_data);
DBMS_XMLDOM.WRITETOFILE(doc, 'XML_DIR/'||v_tablename);
我的表
ID Name SAL HIREDATE DEPTNO E_MAIL
1 xyz 23 01-JAN-00 2 [email protected]
2 - - - 23 - - - - - - - - - - [email protected]
XML輸出
<?xml version="1.0" ?>
<ROWSET>
<ROW>
<ID>1</ID>
<NAME>xyz</NAME>
<SAL>23</SAL>
<HIREDATE>01-JAN-00</HIREDATE>
<DEPTNO>2</DEPTNO>
<E_MAIL>[email protected]</E_MAIL>
</ROW>
<ROW>
<ID>1</ID>
<SAL>23</SAL>
<E_MAIL>[email protected]</E_MAIL>
</ROW>
</ROWSET>
我想這樣做
<?xml version="1.0" ?>
<ROWSET>
<ROW>
<ID>1</ID>
<NAME>xyz</NAME>
<SAL>23</SAL>
<HIREDATE>01-JAN-00</HIREDATE>
<DEPTNO>2</DEPTNO>
<E_MAIL>[email protected]</E_MAIL>
<ROW>
<ID>2</ID>
<NAME></NAME>
<SAL>23</SAL>
<HIREDATE></HIREDATE>
<DEPTNO></DEPTNO>
<E_MAIL>[email protected]</E_MAIL>
</ROW>
</ROWSET>
APC謝謝你...工作... – Chicharito 2010-02-08 11:29:10