Commit 26023f24 authored by bpandey's avatar bpandey

modify EORLocationStock.java change syntax of sql according to DB2 database


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97110 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 35581498
......@@ -158,7 +158,7 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe
StringBuffer sqlStr = null;
int count = 0;
String locCode = "";
String sysDate = " current_timestamp";
String sysDate = "sysdate()";
final String yseStrng = "Yes";
try
{
......@@ -172,11 +172,11 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe
}
if (expDate != null && expDate.trim().length() != 0 && expDate.equalsIgnoreCase(yseStrng))
{
sqlStr.append(" and s.exp_date < = " + sysDate);
sqlStr.append(" and s.exp_date <= " + sysDate);
}
if (reTestDate != null && reTestDate.trim().length() != 0 && reTestDate.equalsIgnoreCase(yseStrng))
{
sqlStr.append(" and s.retest_date < =" + sysDate);
sqlStr.append(" and s.retest_date <=" + sysDate);
}
sql = "select loc_code,loc_phy_row,loc_phy_col,loc_phy_stack from location where loc_phy_area = ? and site_code = ? " + locCode + " order by loc_phy_row, loc_phy_stack ,loc_phy_col";
pstmt = conn.prepareStatement(sql);
......@@ -217,14 +217,14 @@ public class EORLocationStock extends ValidatorEJB implements EORLocationStockRe
}
xmlData.append("<loc_phy_col col=\"" + checkNull(rs.getString("loc_phy_col")) + "\">");
sql = "select s.item_code, s.site_code, s.loc_code, s.lot_no, s.lot_sl, s.exp_date, s.quantity, s.alloc_qty, s.hold_qty , s.mfg_date, s.exp_date, s.retest_date , i.descr from stock s ,item i where s.quantity >0 and s.exp_date <= sysdate and s.item_code=i.item_code and s.loc_code =? and s.site_code =? " + sqlStr.toString();
sql = "select s.item_code, s.site_code, s.loc_code, s.lot_no, s.lot_sl, s.exp_date, s.quantity, s.alloc_qty, s.hold_qty , s.mfg_date, s.exp_date, s.retest_date , i.descr from stock s ,item i where s.quantity >0 and s.exp_date <= sysdate() and s.item_code=i.item_code and s.loc_code =? and s.site_code =? " + sqlStr.toString();
System.out.println("sql is="+sql);
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, locationCode);
pstmt1.setString(2, siteCode);
rs1 = pstmt1.executeQuery();
xmlData.append("<location_code lcode=\"" + locationCode + "\">");
while (rs1.next())
{
xmlData.append("<stock>");
......
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