相关的SQL语句如下:CREATE TABLE some_xml (x XMLType); /*建立XMLType表*/
INSERT INTO some_xml
VALUES('<ManuInstructions ProductModelID="1" ProductModelName="SomeBike" >
<Location LocationID="L1" >
<Step>Manu step 1 at Loc 1</Step>
<Step>Manu step 2 at Loc 1</Step>
<Step>Manu step 3 at Loc 1</Step>
</Location>
<Location LocationID="L2" >
<Step>Manu step 1 at Loc 2</Step>
<Step>Manu step 2 at Loc 2</Step>
<Step>Manu step 3 at Loc 2</Step>
</Location>
</ManuInstructions>'); /*插入XML数据*/FLWOR表达式:$step in /ManuInstructions/Location[1] return string($step)
这个表达式是否有错?
请高手帮忙写一个SELECT语句在SQL*Plus中显示我要显示的内容,即:Manu step 1 at Loc 2Manu step 2 at Loc 2Manu step 3 at Loc 2
INSERT INTO some_xml
VALUES('<ManuInstructions ProductModelID="1" ProductModelName="SomeBike" >
<Location LocationID="L1" >
<Step>Manu step 1 at Loc 1</Step>
<Step>Manu step 2 at Loc 1</Step>
<Step>Manu step 3 at Loc 1</Step>
</Location>
<Location LocationID="L2" >
<Step>Manu step 1 at Loc 2</Step>
<Step>Manu step 2 at Loc 2</Step>
<Step>Manu step 3 at Loc 2</Step>
</Location>
</ManuInstructions>'); /*插入XML数据*/FLWOR表达式:$step in /ManuInstructions/Location[1] return string($step)
这个表达式是否有错?
请高手帮忙写一个SELECT语句在SQL*Plus中显示我要显示的内容,即:Manu step 1 at Loc 2Manu step 2 at Loc 2Manu step 3 at Loc 2
解决方案 »
- C#如何调入oracle函数,并返回值
- 转移字符escape后面什么都可以跟吗
- oracle的存储过程
- 请UNIX下有ORACLE开发经验的高手帮帮我,高分求救,春节快乐
- 紧急求助!UNIX下创建数据库(用数据库配置助手DBCA)总提示有错!请指教...
- 本人想学习下sql编程,请大家给推荐本书
- name server配置了之后开启保措施怎么回事,谢谢大虾!
- 请问各位大虾,小弟出来乍到,现在有一Oracle817数据库的数据复制问题,分数200清囊相送!!!
- 考一个认证,要多少钱呀
- 在JSP中有没有像ASP中的response.end语句?
- oracle中类似于sqlserver中.的通配符
- 怎样将注释的这行也加进去,打印出3列呢
select xmlquery('for $step in /ManuInstructions/Location[1]
return string($step)'
passing x returning content) xml
from some_xml ;XML
----------------------------------------------------------------
Manu step 1 at Loc 1Manu step 2 at Loc 1Manu step 3 at Loc 1
return string($step)'
passing x returning content) xml
from some_xml;XML
----------------------------------------------------------------
Manu step 1 at Loc 2Manu step 2 at Loc 2Manu step 3 at Loc 2 最好,改成按属性查找select xmlquery('for $step in /ManuInstructions/Location
where $step/@LocationID eq "L2"
return string($step)'
passing x returning content) xml
from some_xml;XML
----------------------------------------------------------------
Manu step 1 at Loc 2Manu step 2 at Loc 2Manu step 3 at Loc 2