[文章摘要]介绍了oracle9i的xmltype数据类型的基本使用
包括:建立含有xmltype数据类型的表
插入(insert)数据
查询(select)数据
更新(update)数据
添加超过4k字节的xml文档到xmltype型字段
适合初学者。
 

关键词: oracle9i xmltype


oracle从9i开始支持一种新的数据类型---- xmltype,用于存储和管理xml数据,并提供了很多的functions,用来直接读取xml文档和管理节点。下面将介绍xmltype的一些基本使用。

1.建立含有xmltype数据类型的表
create table abc (id number,xmldoc sys.xmltype);
声明xmltype型字段用:sys.xmltype 

2.向带有xmltype类型的表插入带有数据
insert into abc (id,xmldoc) value (abc.nextval , sys.xmlType.createXML('<name><a >5.添加超过4k字节的xml文档到xmltype型字段
可以通过使用临时表的办法实现:
先建立一个临时的表,其中的一个字段是clob类型;
再将要写入xmltype字段的xml doc写入这个临时的clob型的字段中;
最后insert into abc (id,xmldoc) values (abc_q.nextval , sys.xmlType.createXML((select content from 临时表 where id=......)));
 
程序员的基础教程:菜鸟程序员
包括:建立含有xmltype数据类型的表
插入(insert)数据
查询(select)数据
更新(update)数据
添加超过4k字节的xml文档到xmltype型字段
适合初学者。
 

关键词: oracle9i xmltype


oracle从9i开始支持一种新的数据类型---- xmltype,用于存储和管理xml数据,并提供了很多的functions,用来直接读取xml文档和管理节点。下面将介绍xmltype的一些基本使用。

1.建立含有xmltype数据类型的表
create table abc (id number,xmldoc sys.xmltype);
声明xmltype型字段用:sys.xmltype 

2.向带有xmltype类型的表插入带有数据
insert into abc (id,xmldoc) value (abc.nextval , sys.xmlType.createXML('<name><a >5.添加超过4k字节的xml文档到xmltype型字段
可以通过使用临时表的办法实现:
先建立一个临时的表,其中的一个字段是clob类型;
再将要写入xmltype字段的xml doc写入这个临时的clob型的字段中;
最后insert into abc (id,xmldoc) values (abc_q.nextval , sys.xmlType.createXML((select content from 临时表 where id=......)));

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2021-06-10
  • 2021-09-05
  • 2021-11-16
  • 2021-08-31
  • 2021-09-28
猜你喜欢
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-06-28
  • 2021-10-16
相关资源
相似解决方案