Commit 5f999364 authored by vpatil's avatar vpatil

Changed by Pragyan Date 10/04/14 Bug fix Integer fld value set with character values


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97810 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e1d1d11f
package ibase.webitm.ejb.dis; package ibase.webitm.ejb.dis;
import java.sql.*; import java.sql.*;
import java.sql.Date;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.io.File; import java.io.File;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import ibase.webitm.ejb.dis.DistCommon; import ibase.webitm.ejb.dis.DistCommon;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.webitm.ejb.ITMDBAccessEJB; import ibase.webitm.ejb.ITMDBAccessEJB;
...@@ -1776,16 +1776,37 @@ public class StockUpdate ...@@ -1776,16 +1776,37 @@ public class StockUpdate
if(errString.trim().length() > 0){ if(errString.trim().length() > 0){
return errString; return errString;
} }
sql =" update stockvalue " // Changed by Pragyan Date 10/04/14 Bug fix Integer fld value set with character values
/*sql =" update stockvalue "
+"set value = (case when value is null then 0 else value end) + (case when '"+this.netAmt+"' is null then 0 else '"+this.netAmt+"' end) " +"set value = (case when value is null then 0 else value end) + (case when '"+this.netAmt+"' is null then 0 else '"+this.netAmt+"' end) "
+" where item_code ='"+this.itemCode+"'" +" where item_code ='"+this.itemCode+"'"
+" and site_code ='"+this.siteCode+"'" +" and site_code ='"+this.siteCode+"'"
+" and VALUE_KEY = '"+this.grade+"'"; +" and VALUE_KEY = '"+this.grade+"'";*/
sql =" update stockvalue "
+"set value = (case when value is null then 0 else value end) + (case when '"
+ "? is null then 0 else ? end) "
+" where item_code =?"
+" and site_code =?"
+" and VALUE_KEY = ?";
System.out.println("Query :::- ["+sql+"]"); System.out.println("Query :::- ["+sql+"]");
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate(); pstmt.setDouble(1, this.netAmt);
pstmt.setDouble(2, this.netAmt);
pstmt.setString(3, this.itemCode);
pstmt.setString(4, this.siteCode);
pstmt.setString(5, this.grade);
int K = pstmt.executeUpdate();
if(K > 0)
{
System.out.println("Data Updated Successfully at StockValue");
}
} }
}else if(count == 0){ }else if(count == 0){
if (this.tranType.equalsIgnoreCase("R")){ if (this.tranType.equalsIgnoreCase("R")){
......
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