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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Parameter from URL

Status
Not open for further replies.

ConBran

Technical User
Jan 4, 2005
29
GB
Hi folks,

was just wondering if any of you guys could shed some light on this error that is cropping up throughout my coldFusion project.

I am passing a parameter on my url, so the url would look like this:

../users/index.cfm?USERS_key=1&search=true

Unfortunately, i get the following coldFusion error thrown up. The error occurs in my sql statement where i am calling the parameter:

83: and USERS.USERS_key = '#URL.USRS_key#'

ColdFusion then outputs the entire select statement, and the last value is infact:

USERS.USERS_key= '1'
(which is the correct user key and is an actual user key in the database)

When I expanded the ColdFusion error, it explains it as thus:

java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][ODBC Socket][MicroSoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

Then the usual bumpf.

Any and all help would be appreciated. Cheers
 
Oops, poor typing on my part the error should read:

83: and USERS.USERS_key = '#URL.USERS_key#'

Sorry!
 
Make sure all of the column names in your query exist in the table being queried, and make sure the information you're passing is correct for the datatype. For example, in USERS.USERS_key= '1', is USERS_key a numeric datatype? If so, you need to remove the quotes from '1'.


Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
as a note, I would call the url variable something like user_id. something about giving table field names to the public scares me :)

 
Hey Guys,

Thanks very much, i checked it all out and what i needed to do was remove the quotes - D'OH!

Spent ages looking at it telling myself it was right, couldn't see the simple school boy error i'd made.

THANKS AGAIN!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top