• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Too few parameters. Expected 3

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

I m trying to run select query with "group by" to get the customer information (using MS Access DB), but getting "Too few parameters. Expected 3" exception.

Noticed when I run select query along with subquery to pull last 24 hrs of sum of records I m getting this exception, without subquery getting expected output.
Joining 3 tables to get list of all records. Please let me know, is there a way I can run below mentioned query along with subquery or do I need to split into 2 parts.
One without subquery and otherone running subquery as seprate.



Exception:


Please advice.
 
author & internet detective
Posts: 40487
823
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure that is the code? As written, it looks like it shouldn't work at all.

Here's what I see happening:
  • create a Statement object without SQL (which implies the query would be passed later - except that this object is never used)
  • set parameters on the PreparedStatement - which is null - this would throw a NullPointer
  •  
    Ranch Hand
    Posts: 86
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    >CS.OUT_TIME between ? and ? and ...
    Try (CS.OUT_TIME between ? and ?) and ... May your sql syntax is too complicated to be understood by MS Access.
     
    Screaming fools! It's nothing more than a tiny ad:
    the value of filler advertising in 2020
    https://coderanch.com/t/730886/filler-advertising
    reply
      Bookmark Topic Watch Topic
    • New Topic