如何在SQL命令中使用C#添加HANA参数

时间:2019-05-18 12:31:33

标签: c# telerik-grid hana

我正在使用C#和Hana数据库,我需要在SQL命令中设置HANA SQL参数

 string AcctCode = dataItem.GetDataKeyValue("AcctCode").ToString();
                        e.DetailTableView.DataSource = GetDataTable(" SELECT  distinct \"JDT1\".\"Account\",\"OINV\".\"CardCode\",\"OINV\".\"DocNum\", \"OINV\".\"CardName\", \"OINV\".\"DocDate\", \"OINV\".\"DocDueDate\", MAX(CASE  WHEN \"OINV\".\"DocDueDate\" < '2019-05-09' THEN \"OINV\".\"DocTotal\" END) AS \"total1\", MAX(CASE  WHEN \"OINV\".\"DocDueDate\" < '2019-05-09'  THEN \"OINV\".\"PaidToDate\" END) AS \"paidtodate1\", MAX(CASE  WHEN \"OINV\".\"DocDueDate\"  BETWEEN '2019-05-09' AND ADD_DAYS(TO_DATE('2019-05-09', 'YYYY-MM-DD'), 7)  THEN \"OINV\".\"DocTotal\" END) AS \"total2\" FROM(\"TUBEPR\".\"JDT1\" \"JDT1\" LEFT OUTER JOIN \"TUBEPR\".\"OJDT\" \"OJDT\" ON \"JDT1\".\"TransId\" = \"OJDT\".\"TransId\") LEFT OUTER JOIN \"TUBEPR\".\"OINV\" \"OINV\" ON \"OJDT\".\"TransId\" = \"OINV\".\"TransId\" WHERE  \"OINV\".\"CANCELED\" = 'N'   AND \"OINV\".\"DocStatus\" = 'O' and \"OINV\".\"DocDueDate\" <= '2019-05-30' and(\"JDT1\".\"Account\" = :AcctCode) group by \"OINV\".\"CardCode\", \"OINV\".\"DocNum\", \"OINV\".\"CardName\", \"OINV\".\"DocDate\", \"OINV\".\"DocDueDate\", \"JDT1\".\"Account\" ", AcctCode);                      

0 个答案:

没有答案