Commit 3e253d58 authored by msingh's avatar msingh

Changes for MS SQL SERVER on 07/10/2015 .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98664 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f5e55ea8
......@@ -1932,11 +1932,24 @@ public class ConsolidatToDoc {
try
{
//Changed by dhanraj on 29-SEP-14 as per pragyan sir tare and filler wt sum of status 'M' and 'A'.
// sql = " SELECT SUM(NVL(FILLER_WEIGHT,0)) FILLER_WEIGHT , SUM(NVL(TARE_WEIGHT,0)) TARE_WEIGHT FROM CARTON_MASTER "
// +" WHERE PTCN = ? AND CARTON_TYPE = 'M' AND STATUS <> 'R' ";
// sql = " SELECT SUM(NVL(FILLER_WEIGHT,0)) FILLER_WEIGHT , SUM(NVL(TARE_WEIGHT,0)) TARE_WEIGHT FROM CARTON_MASTER "
// +" WHERE PTCN = ? AND CARTON_TYPE = 'M' AND STATUS <> 'R' ";
//changed by manish on 14/09/15 for Ms sql server databse (replace NVL and add isnull).
String DB = CommonConstants.DB_NAME;
if("mssql".equalsIgnoreCase(DB))
{
sql = " SELECT SUM(isnull(FILLER_WEIGHT,0)) FILLER_WEIGHT , SUM(isnull(TARE_WEIGHT,0)) TARE_WEIGHT FROM CARTON_MASTER "
+" WHERE PTCN = ? AND (CARTON_TYPE = 'M' OR CARTON_TYPE = 'A') AND STATUS <> 'R' ";
}
//changed by manish on 14/09/15 for Ms sql server databse (replace NVL and add isnull).
else
{
sql = " SELECT SUM(NVL(FILLER_WEIGHT,0)) FILLER_WEIGHT , SUM(NVL(TARE_WEIGHT,0)) TARE_WEIGHT FROM CARTON_MASTER "
+" WHERE PTCN = ? AND (CARTON_TYPE = 'M' OR CARTON_TYPE = 'A') AND STATUS <> 'R' ";
}
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,ptcn);
rSet = pstmt.executeQuery();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment