首页 >数据库 >mysql教程 >Oracle xml数据构建 XMLType相关函数

Oracle xml数据构建 XMLType相关函数

WBOY
WBOY原创
2016-06-07 17:03:001109浏览

准备测试数据:create table teacher (id varchar2(10),name varchar2(20),remark varchar2(50));create table course (id varch







XMLTRANSFORM(xmltype_instance,xsl_ss):该函数用于将XMLType实例按照XSL样式进行转换,并生成新的XMLType实例。示例如下:
SQL> SELECT XMLTRANSFORM(w.warehouse-spec,x.coll).GetClobVal()
2 FROM warehouse w,xsl_tab x
3 WHERE w.warehouse_name='San Francisco';

CREATE TABLE purchase_order( po_no number(9),po_file xmltype)

insert into purchase_order values(68,XMLTYPE('
 

index.jsp
1


index2.jsp
2

'))


SELECT extract(po_file,'out/record/FileName').getStringVal() AS FileName,extract(po_file,'out/record/FileID').getStringVal() AS FileID FROM purchase_order

SELECT extract(po_file,'out/record/@id').getStringVal() AS RECORD FROM purchase_order


SELECT extract(po_file,'out/record/FileName').getStringVal() AS FileName FROM purchase_order


select extractValue(value(i),'/FileName') AS FileName 
from purchase_order x,
table(XMLSequence(extract(x.po_file,'out/record/FileName'))) i

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn