Skip to main content
Inspiring
March 26, 2007
Answered

query prob

  • March 26, 2007
  • 2 replies
  • 351 views
Having a little beginners bad-luck with the following code;

<html>
<head>
<cfparam name="lastname" type="string">
<cfquery name="GetIndiv" datasource="AS400" username="quser" password="quser" dbtype="odbc">
select ISLNAM from istatic
where ISLNAM = #ucase(lastname)#

</cfquery>
<cfif GetIndiv.recordcount is 0>

<cfoutput> <br> Invalid user ID or password <br> </cfoutput>


<cfelse>


<cfoutput> <br> query="GetIndiv" <br> </cfoutput>

</cfif>

</head>
</html>


If the value of lastname is "Smith", then I get an error saying that Smith is not a column name.



This topic has been closed for replies.
Correct answer cf_dev2
where ISLNAM = '#ucase(lastname)#'

2 replies

cf_dev2Correct answer
Inspiring
March 26, 2007
where ISLNAM = '#ucase(lastname)#'
larksysAuthor
Inspiring
March 26, 2007
BTW - lastname is passed in and is converted to all caps. The value of lastname is reported in the sql error message properly.