DB2中的XPath查询

时间:2013-08-28 21:15:53

标签: xml xpath db2

我在DB2列上的DB2中执行以下查询,它运行正常:

SELECT  
FROM customer
WHERE contains(search_text, 
'
@xpath:''/customer/number[. contains("123456")]''
', 'RESULTLIMIT = 100')=1;

但以下查询不起作用:

SELECT  
FROM customer
WHERE contains(search_text, 
'
@xpath:''/customer/number[. = "123456"]''
', 'RESULTLIMIT = 100')=1;

为什么第二个查询不起作用的任何想法? 我得到的错误是: 错误[38H10] [IBM] [DB2 / LINUXX8664] SQL20423N使用索引“CISC_CUSTOMER”在服务器“localhost”上进行文本搜索处理期间发生错误。错误消息是“”IQQS0032E查询无法处理“。

<customer>
<number>
123456
</number>
<firstname>
John 
</firstname>
<lastname>
Smith
</lastname>
</customer>

1 个答案:

答案 0 :(得分:0)

在DB2中,你只能对属性使用“=”,对于我只能使用“contains”的元素。