PDA

View Full Version : Invalid CFML construct


Ty.Taylor116345
04-05-2009, 07:06 AM
I am receiving the following error when I try to use search. I ran the wizard and it returns this error when I search for anything.


Invalid CFML construct found on line 235 at column 119.
ColdFusion was looking at the following text:

Stock

The CFML compiler was processing:

* An expression beginning with URLEncodedFormat, on line 235, column 90.This message is usually caused by a problem in the expressions structure.
* The body of a cfoutput tag beginning on line 231, column 12.
* The body of a cfoutput tag beginning on line 231, column 12.


The error occurred in C:\websites\AmericanWeaponSystemsBeta.com\RSR_Resu lts.cfm: line 235

233 : <td></div>
234 : <div class="WADAResultInfoArea">
235 : <div class="WADAResultTitle"><a href="RSR_Detail.cfm?RSRStockNumber=#URLEncodedFormat(WA DARSR.RSR Stock Number)#">#WADARSR.Full Manufacturer Name#</a></div>
236 : <div class="WADAResultDescription">#WADARSR.Product Description# <a href="RSR_Detail.cfm?RSRStockNumber=#URLEncodedFormat(WA DARSR.RSR Stock Number)#">More...</a></div>
237 : <div class="WADAResultCommerceArea">

Ray Borduin
04-06-2009, 07:45 AM
It doesn't like this line of code:

#URLEncodedFormat(WADARSR.RSRStockNumber)#

It is hard to say what might be wrong with it without actively debugging.

Danilo Celic
04-06-2009, 11:59 AM
The code you pasted appears to have spaces in the column names. Is that correct? If so, then once way around this might be use switch to using something like:
#URLEncodedFormat(WADARSR['RSR Stock Number'])#

Or better yet, remove the spaces from outputs and update your SQL so that it selects the column name(s) with spaces and creates aliases for the columns without spaces. How to do that would depend on the database that you're using, but it might look something like this for MySQL:

SELECT `RSR Stock Number` as RSRStockNumber, ....

In MySQL, the ` character is an escape character. Is that block of code generated by DataAssist, or did you create this block of code and then drag in the data bindings from the Bindings panel?


FYI: it's considered bad practice to have spaces and any other special character in column names as it will cause issues within SQL and output of values from a query without taking steps to workaround them. Best to not have the spaces to begin with.