-- 作者:consoft
-- 发布时间:5/26/2008 9:34:00 AM
-- 如何用C或者C++把Oracle中的表生成下面的xml文件?
用ADO访问Oracle数据库,可以把数据库中的表生成下面格式的xml文件 我现在的问题是:如何不通过ADO,用C或者C++直接生成这样的文件,因为我的程序要在Linux上运行,需要把Oracle中的表数据 导出下面这样的xml,然后传给客户端使用,有没有现成的C或者C++代码? <xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'> <s:Schema id='RowsetSchema'> <s:ElementType name='row' content='eltOnly' rs:updatable='true'> <s:AttributeType name='ZMLM' rs:number='1' rs:writeunknown='true' rs:basetable='BZZD' rs:basecolumn='ZMLM'> <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='3' rs:maybenull='false'/> </s:AttributeType> <s:AttributeType name='HZZM' rs:number='2' rs:nullable='true' rs:writeunknown='true' rs:basetable='BZZD' rs:basecolumn='HZZM'> <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='10'/> </s:AttributeType> <s:AttributeType name='BJM' rs:number='3' rs:nullable='true' rs:writeunknown='true' rs:basetable='BZZD' rs:basecolumn='BJM'> <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='1'/> </s:AttributeType> <s:AttributeType name='BBRQ' rs:number='4' rs:nullable='true' rs:writeunknown='true' rs:basetable='BZZD' rs:basecolumn='BBRQ'> <s:datatype dt:type='dateTime' rs:dbtype='timestamp' dt:maxLength='16' rs:scale='0' rs:precision='19' rs:fixedlength='true'/> </s:AttributeType> <s:AttributeType name='BBBB' rs:number='5' rs:nullable='true' rs:writeunknown='true' rs:basetable='BZZD' rs:basecolumn='BBBB'> <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='2'/> </s:AttributeType> <s:AttributeType name='QNAME' rs:number='6' rs:nullable='true' rs:writeunknown='true' rs:basetable='BZZD' rs:basecolumn='QNAME'> <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='16'/> </s:AttributeType> <s:AttributeType name='TBSJ' rs:number='7' rs:nullable='true' rs:writeunknown='true' rs:basetable='BZZD' rs:basecolumn='TBSJ'> <s:datatype dt:type='dateTime' rs:dbtype='timestamp' dt:maxLength='16' rs:scale='0' rs:precision='19' rs:fixedlength='true'/> </s:AttributeType> <s:AttributeType name='SXBZZ' rs:number='8' rs:nullable='true' rs:writeunknown='true' rs:basetable='BZZD' rs:basecolumn='SXBZZ'> <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='3'/> </s:AttributeType> <s:AttributeType name='XXBZZ' rs:number='9' rs:nullable='true' rs:writeunknown='true' rs:basetable='BZZD' rs:basecolumn='XXBZZ'> <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='3'/> </s:AttributeType> <s:AttributeType name='DJH' rs:number='10' rs:nullable='true' rs:writeunknown='true' rs:basetable='BZZD' rs:basecolumn='DJH'> <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='6'/> </s:AttributeType> <s:AttributeType name='ROWID' rs:number='11' rs:nullable='true' rs:rowid='true' rs:basetable='BZZD' rs:basecolumn='ROWID' rs:keycolumn='true' rs:hidden='true' rs:autoincrement='true'> <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='18' rs:fixedlength='true'/> </s:AttributeType> <s:extends type='rs:rowbase'/> </s:ElementType> </s:Schema> <rs:data> <z:row ZMLM='NNG' HZZM='南昌南' BJM='H' BBRQ='2003-07-28T00:00:00' BBBB='白' QNAME='YCFJQ' TBSJ='2003-07-25T00:00:00' ROWID='AAABFiAADAAAA5DAAA'/> </rs:data> </xml>
|