Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I am getting the following error. Can anyone clear it?

 
Vin Khan
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[ibm][db2][jcc][10145][10844] Invalid parameter 1: Parameter index is out of range.

These are the codes involved:

qry = new StringBuffer("SELECT a.REQUESTNO, a.UNITCODE, a.DESCRIPTION, LASTMODIFIEDUSER, a.REQUESTEDUSER, a.REQUESTTYPE, a.REQUESTEDDATE, ora.to_char(a.LASTMODIFIEDDATE, 'dd-mm-yyyy') as LASTMODIFIEDDATE1, a.LASTMODIFIEDDATE from CTSBILLUNITREQUEST a LEFT OUTER JOIN CTSBILLUNIT c ON a.UNITCODE = c.UNITCODE");
if(getValueObject().getRequestNo() != null ){qry.append(" WHERE a.REQUESTNO = "+ RequestNo +" ");}
if (tcv.getUnitCode() != null && !"".equals(tcv.getUnitCode()) && !"ALL".equals(tcv.getUnitCode()) ){qry.append(" and a.UNITCODE = c.UNITCODE");}
qry.append(" order by a.UNITCODE");
PreparedStatement ps = getPreparedStatement(qry.toString());
ctr = 1;
if (tcv.getUnitCode() != null && !"".equals(tcv.getUnitCode()) && !"ALL".equals(tcv.getUnitCode()) ){ps.setString(ctr++, tcv.getUnitCode());}
if (tcv.getRequestNo() != null && !"".equals(tcv.getRequestNo()) ){ps.setString(ctr++, tcv.getRequestNo());}
ps.executeQuery();
 
Vin Khan
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vin Khan wrote:[ibm][db2][jcc][10145][10844] Invalid parameter 1: Parameter index is out of range.

These are the codes involved:

qry = new StringBuffer("SELECT a.REQUESTNO, a.UNITCODE, a.DESCRIPTION, LASTMODIFIEDUSER, a.REQUESTEDUSER, a.REQUESTTYPE, a.REQUESTEDDATE, ora.to_char(a.LASTMODIFIEDDATE, 'dd-mm-yyyy') as LASTMODIFIEDDATE1, a.LASTMODIFIEDDATE from CTSBILLUNITREQUEST a LEFT OUTER JOIN CTSBILLUNIT c ON a.UNITCODE = c.UNITCODE");
if(getValueObject().getRequestNo() != null ){qry.append(" WHERE a.REQUESTNO = "+ RequestNo +" ");}
if (tcv.getUnitCode() != null && !"".equals(tcv.getUnitCode()) && !"ALL".equals(tcv.getUnitCode()) ){qry.append(" and a.UNITCODE = c.UNITCODE");}
qry.append(" order by a.UNITCODE");
PreparedStatement ps = getPreparedStatement(qry.toString());
ctr = 1;
if (tcv.getUnitCode() != null && !"".equals(tcv.getUnitCode()) && !"ALL".equals(tcv.getUnitCode()) ){ps.setString(ctr++, tcv.getUnitCode());}
if (tcv.getRequestNo() != null && !"".equals(tcv.getRequestNo()) ){ps.setString(ctr++, tcv.getRequestNo());}
ps.executeQuery();
 
Vin Khan
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please anyone help me as soon as possible
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic