Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too few parameters. Expected 1. 1

Status
Not open for further replies.

A1Pat

IS-IT--Management
Jun 7, 2004
454
US
Hi all,

I'm getting this error:

Desc : [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

SQL : SELECT a.idProduct,a.description,a.descriptionLong, a.listPrice,a.price,a.smallImageUrl,a.stock, a.fileName,a.noShipCharge, (SELECT c.categoryDesc FROM Categories_Products b, Categories c WHERE b.idCategory = c.idCategory AND c.idProduct = a.idProduct) AS catDesc FROM products a WHERE a.active = -1 AND a.homePage = -1 ORDER BY a.idProduct ASC

Please tell me where have I gone wrong.

I looked up the ERROR and found that, typically, it was caused by calling wrong fieldname, and I did check for any mistype of anything else. Found nothing that I know how to fix the ERROR.

Thanks.
 
I'd replace this:
c.idProduct
with this:
b.idProduct

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes PHV, you're right! that helped me recognized the error. Thank you, however, we're now facing another error:

Desc : [Microsoft][ODBC Microsoft Access Driver] At most one record can be returned by this subquery.

SQL : SELECT a.idProduct,a.description,a.descriptionLong, a.listPrice,a.price,a.smallImageUrl,a.stock, a.fileName,a.noShipCharge, (SELECT c.categoryDesc FROM Categories_Products b, Categories c WHERE b.idCategory = c.idCategory AND b.idProduct = a.idProduct) AS catDesc FROM products a WHERE a.active = -1 AND a.homePage = -1 ORDER BY a.idProduct ASC

I'm searching around to explain this error but no luck so far. Could you help.
 
Why a subquery ?
SELECT a.idProduct,a.description,a.descriptionLong, a.listPrice,a.price,a.smallImageUrl,a.stock, a.fileName,a.noShipCharge,c.categoryDesc
FROM (Categories_Products b
INNER JOIN Categories c ON b.idCategory = c.idCategory)
INNER JOIN products a ON b.idProduct = a.idProduct
WHERE a.active = -1 AND a.homePage = -1
ORDER BY a.idProduct

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
AHA!!! Thank you for your help very much, PHV. Keep up the good work!!!

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top