我在MAC OSX 10.7.5上使用WSO2 4.0.3和Java 1.6.0_37-b06-434-11M3909。
我对ESB中部署的数据服务功能有疑问。
我有以下XML作为输入
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<validateBusinessArea xmlns="http://****.com"
xmlns:xsd="http://*****.com/xsd">
<request>
<xsd:businessArea>
<xsd:genLedgeSiteNumber>0056</xsd:genLedgeSiteNumber>
<xsd:businessAreaCode>0002</xsd:businessAreaCode>
</xsd:businessArea>
<xsd:businessArea>
<xsd:genLedgeSiteNumber>0062</xsd:genLedgeSiteNumber>
<xsd:businessAreaCode>9362</xsd:businessAreaCode>
</xsd:businessArea>
<xsd:businessArea>
<xsd:genLedgeSiteNumber>0071</xsd:genLedgeSiteNumber>
<xsd:businessAreaCode>9999</xsd:businessAreaCode>
</xsd:businessArea>
</request>
</validateBusinessArea>
</soapenv:Body>
</soapenv:Envelope>
根据businessArea元素的数量,我必须在下面的SQL子句后面附加。
SELECT COL-1,COL-2, COL-3, COL-4 as validCount
FROM TABLE_NAME
WHERE ?
因此查询将成为
SELECT COL-1,COL-2, COL-3, COL-4 as validCount
FROM TABLE_NAME
WHERE
(GL_SITE_NO = '0056'
AND BUSINESS_AREA_CODE = '0002')
OR
(GL_SITE_NO = '0062'
AND BUSINESS_AREA_CODE = '9362')
OR
(GL_SITE_NO = '0071'
AND BUSINESS_AREA_CODE ='9999')
Group by GL_SITE_NO,BUSINESS_AREA_CODE
因此,这取决于SQL语句的主“where”子句中的“OR”子句的businessArea元素数量的变化。如果我们在输入XML中有2个“businessArea”元素,我将在SQL中有2个OR clasues。
我们可以使用ESB 4.0.3中的数据服务功能构建动态SQL吗?
请告诉我。 谢谢 作者Abhijit
对此有任何更新......如果有可能,任何机构都可以告诉我吗?感谢