Home > Database > Mysql Tutorial > body text

Oracle xml数据构建 XMLType相关函数

WBOY
Release: 2016-06-07 17:03:00
Original
1070 people have browsed it

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

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!