0

我有一个 db2 查询

SELECT SECTIONTITLE, VMETE.COALESCE_XML(XMLQUERY('$c/Details/UserResource[ResourceGroup=@VmeMerchantId_0]' passing i.SECTIONCONTENT as "c"), i.SECTIONCONTENT) as SECTIONCONTENT 
FROM VMETE.IPSP_CONFIGURATION i 
WHERE ("IPSPID" = @IPSP_ID_0) AND ("EFFECTIVETO" = @EFFECTIVE_TO_0) ORDER BY SORTORDER

其中有 3 个参数 @VmeMerchantId_0 @IPSP_ID_0 @EFFECTIVE_TO_0

在我的命令对象中,有三个参数

[0] = {@VmeMerchantId_0}
[1] = {@IPSP_ID_0}
[2] = {@EFFECTIVE_TO_0}

为什么只有 [1][2] 被传递到查询中,而 [0] 被忽略?

COALESCE_XML是我写的一个函数,你可以认为是COALESCE

4

1 回答 1

0

我认为这可能有效:

XMLQUERY('$c/Details/UserResource[ResourceGroup=$var]' 
   passing i.SECTIONCONTENT as "c", @VmeMerchantId_0 as "var")
于 2013-08-20T20:55:54.170 回答