• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please anyone help me as soon as possible
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic