• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL Error :Too few parameters.

 
Padmaja Godbole
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running the following query from my java program :
select * from OtherValues where StructureID = 0 and (DPID is null or DPID="");
I am getting error :
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Although the query running fine in Access directly.
pls suggest..
Thanks in advance.
 
Padmaja Godbole
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
double quotes was the problem , I changed the query and now its working.
select * from OtherValues where StructureID = 0 and (DPID is null or DPID='');
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Padmaja, and thanks for sharing what you learned. Hope to see you 'round the Ranch!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic