wood burning stoves*
The moose likes JDBC and the fly likes SQL Error :Too few parameters. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Error :Too few parameters. " Watch "SQL Error :Too few parameters. " New topic
Author

SQL Error :Too few parameters.

Padmaja Godbole
Greenhorn

Joined: May 10, 2003
Posts: 14
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<br />---------------------<br />SCJP2
Padmaja Godbole
Greenhorn

Joined: May 10, 2003
Posts: 14
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

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, Padmaja, and thanks for sharing what you learned. Hope to see you 'round the Ranch!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL Error :Too few parameters.
 
Similar Threads
Servlet - JDBC interaction
JDBC & Servlet
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters.
dont know y it occurs Exception: Too few arguments. Expected 2
Access DB