Oracle XmlTable和XQuery:忽略区分大小写

时间:2015-08-28 06:27:13

标签: xml oracle


在Oracle Database 11g 11.2.0.3.0 64bit Production中,我想知道是否有可能在使用XMLTABLE和XQuery的查询中忽略区分大小写;例如,假设我们有一个带标签的xml文件:

/Warehouse
/Warehouse/WaterAccess
/Warehouse/RailAccess

我们执行以下内容(来自http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions253.htm#SQLRF06232的示例):

SELECT warehouse_name warehouse,  
  warehouse2."Water", warehouse2."Rail"  
    FROM warehouses,  
    XMLTABLE('/Warehouse'  
    PASSING warehouses.warehouse_spec  
    COLUMNS   
    "Water" varchar2(6) PATH '/Warehouse/WaterAccess',  
    "Rail" varchar2(6) PATH '/Warehouse/RailAccess')   
    warehouse2;  


WAREHOUSE Water Rail
----------------------------------- ------ ------
Southlake, Texas Y N
San Francisco Y N
New Jersey N N
Seattle, Washington N Y

但是,由于某些原因,下一个xml文件包含以下标记(一些字母小写):

/warehouse
/warehouse/WaterAccess
/warehouse/Railaccess

相同的查询将失败 有没有解决方法(例如使用某种UPPER)? 谢谢,
伊戈尔

1 个答案:

答案 0 :(得分:0)

SELECT warehouse_name warehouse,  
  warehouse2."Water", warehouse2."Rail"  
    FROM warehouses,  
    XMLTABLE('/*/*'  
    PASSING warehouses.warehouse_spec  
    COLUMNS   
    "Water" varchar2(6) PATH '/WaterAccess',  
    "Rail" varchar2(6) PATH '/RailAccess')   
    warehouse2;