Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
PostScript #1
Too few parameters. Expected 3.
I'm starting by disclaiming I have zero background with ColdFusion. I am trying to create a drill-down system where a user selects a category, that selection returns a list of majors that fall under that category, then the user can select a major and see which colleges offer that major. This is based on an existing system that worked similarly, but started with a keyword form instead of the category list. So, the only part that is new is getting the Categories displayed and the selected category sent to the majors query page.
Here is the code I've used to output the categories:
<cfquery name="Categories" datasource="cvcMajorsNew">
SELECT Categories.Categories FROM Categories ORDER BY Categories.Categories
ASC
</cfquery>
<cfoutput query="Categories">
<p style="margin:0 0;line-height:140%;"><a href="choose-major.cfm?categories=#URLEncodedFormat(Categories. Categories)#">#Categories.Categories#</a></p>
</cfoutput>
I get the desired results here—the category list displays with links, but when I click on a link I get the error on the next page:
Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 3.
The error occurred in E:\web\cvc\htdocs\2010\major-search\choose-major.cfm: line 4
2 :
3 : <cfquery name="Majors" datasource="cvcMajorsNew">
4 : SELECT Majors2Categories.Majors, Majors2Categories.Categories, Majors.Majors FROM Majors Majors2Categories WHERE Categories = '#URL.Categories#'
5 : AND Majors.Majors = Majors2Categories.Majors ORDER BY Majors.Majors
6 : ASC
Here is the code for the majors page:
<cfparam name="URL.Categories" default="1">
<cfquery name="Majors" datasource="cvcMajorsNew">
SELECT Majors2Categories.Majors, Majors2Categories.Categories, Majors.Majors FROM Majors Majors2Categories WHERE Categories = '#URL.Categories#'
AND Majors.Majors = Majors2Categories.Majors ORDER BY Majors.Majors
ASC
</cfquery>
<cfoutput query="Majors">
<!--- Determine row color --->
<CFIF CurrentRow MOD 2 IS 1>
<CFSET bgcolor="ffffff">
<CFELSE>
<CFSET bgcolor="648F43">
</CFIF>
<tr bgcolor="#bgcolor#">
<td class="bodytext"><p>#CurrentRow#: <a href="choose-school.cfm?majors=#URLEncodedFormat(Majors.Majors) #">#Majors.Majors#</a></p></td>
</tr>
</cfoutput>
Any help would be GREATLY appreciated—thanks!Last edited by PostScript; March 30th at 01:24 PM.
Junior Member
- Join Date
- Mar 2011
- Location
- Vermont
- Posts
- 2
-
too few parameters expected 1
Hello, I am getting the error message Error: java.sql.SQLException: Too few parameters. Expected 1. All column names in SQL command are matching... -
Too few parameters. Expected 1.
I've searched all over the place, and can't find a solution to this error message to my query. I've come across it before, and I know that a common... -
Too few parameters. Expected 2.
My form page: <cfform action="InstreamUpdate2.cfm" method="post"> <CFQUERY NAME="EditQueryInstreamWork" DATASOURCE="Instreamworks"> select *... -
create parameters without creating parameters
cant you create ado command parameteres without creating a parameter object? i have a function that takes the name of a stored proc, and two... -
Too few parameters. Expected error
"Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message news:<OEuOwifODHA.2224@TK2MSFTNGP10.phx.gbl>... Sorry still having problems with... -
PostScript #2
Re: Too few parameters. Expected 3.
Figured out I was missing a pesky comma! All set now.
Junior Member
- Join Date
- Mar 2011
- Location
- Vermont
- Posts
- 2



Reply With Quote

