• 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

ORA-01008: not all variables bound

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can you please tell where I am wrong, This is urgent.

String count = new String("select count (*) from Detail where" +" serviceCode = '" + service_code + "'" + " and " + " OFFERINGNO= '" + + "'");

try
{
stmnt = conn.prepareStatement("select count (*) from Detail where serviceCode = ? and OFFERINGNO = ? ");

stmnt.setLong(1, service_code);
resSet = stmnt.executeQuery();
while(resSet.next())
{
cont = resSet.getInt(1);
}
resSet.close(); // Release cursor
stmnt.close();
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Swetha,
You have supplied only one argument to prepared statement but in query 2 arguments are required.

serviceCode is set by
I thing you forgot to set
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic