欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Oracle xml数据构建 XMLType相关函数

程序员文章站 2023-12-29 19:42:04
...

准备测试数据: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

上一篇:

下一篇: