This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Vin Khan
Greenhorn
Posts: 3
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please anyone help me as soon as possible
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!