易截截图软件、单文件、免安装、纯绿色、仅160KB

xml procedure

DECLARE @XMLdoc XML
SET @XMLdoc =
'<Book name="SQL Server 2000 Fast Answers">
<Chapters>
<Chapter id="1" name="Installation, Upgrades">
 <CreateDate>2009-12-30</CreateDate>
</Chapter>
<Chapter id="2" name="Configuring SQL Server"/>
<Chapter id="3" name="Creating and Configuring Databases">
 <CreateDate>2009-12-30</CreateDate>
</Chapter>
<Chapter id="4" name="SQL Server Agent and SQL Logs"/>
</Chapters>
</Book>'
DECLARE @docpointer int
EXEC sp_XML_preparedocument @docpointer OUTPUT, @XMLdoc
SELECT *
from OPENXML (@docpointer, '/Book/Chapters/Chapter',1)
WITH (Chapter int '@id',
ChapterNM varchar(50) '@name',
CreateDate VARCHAR(50) './CreateDate/text()')
GO
结果如下:
Chapter    ChapterNM                                              CreateDate
1               Installation, Upgrades                            2009-12-30
2               Configuring SQL Server                           NULL
3               Creating and Configuring Databases      2009-12-30
4               SQL Server Agent and SQL Logs        


相关文档:

Java通过dom4j.jar读取xml文件

/**
 * ftp上传文件JavaBean
 * @author Administrator
 *
 */
public class FtpBean {
 //ftp服务地址
 private String ftpUrl="";
 //ftp用户名
 private String userName="";
 //ftp密码
 private String passWord="";
 
 public String getF ......

C#小Tip:Xml操作简明手册 1


1)Xml文档示例(xmlsample.xml):
 
Code
<?xml version="1.0" encoding="iso-8859-1" ?>
<music>
  <song title="Oh,girl">
    <artist>The Chi-lites</artist>
    <genre>Soul</genre>
  &nb ......

JPetStore 5.0(iBATIS for java)中Item.xml的bug

Caused by: java.sql.SQLException: ORA-00918: column ambiguously defined
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred in com/ibatis/jpetstore/persistence/sqlmapdao/sql/Item.xml. 
--- The error occurred while applying a parameter map.&nbs ......

将数组转化为XML数据

/* Author: 杨宇  yangyu@sina.cn */
/*
用法示例:
$cls_xml = new cls_xml();
if ($array){
 $cls_xml->array2xml($array);
 echo $cls_xml->getXml(); 
}else{
 echo '';
}
*/
class cls_xml{
        var $xml;
  &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号