Darren
<CFQUERY NAME="qryParAddress" datasource="#dsnName#"
password="#dsnPassword#" username="#dsnUsername#">
SELECT *
FROM tablename
</CFQUERY>
<cfloop query="qryParAddress">
<cfloop List="#qryParAddress.ColumnList#" index="Column">
<cfset qryParAddress[Column][CurrentRow] =
Trim(qryParAddress[Column][CurrentRow])>
</cfloop>
</cfloop>
Give that ago
Regards
Steve Onnis
Domain Concept Designs
+61 422 337 685
+61 3 9444 7504
http://www.domainconceptdesigns.com <http://www.domainconceptdesigns.com>
("If you think it can't be done, you haven't asked me!") - Steve Onnis
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Darren
Tracey
Sent: Wednesday, March 05, 2003 5:21 PM
To: CFAussie Mailing List
Subject: [cfaussie] looping over the fields in a query
I need to run a trim against every field that comes back from a particular
query.
I'm trying to loop over each record, and then loop over each field, trim it
and put it back.
Here's the code.
<CFQUERY NAME="qryParAddress" datasource="#dsnName#"
password="#dsnPassword#" username="#dsnUsername#">
SELECT *
FROM tablename
</CFQUERY>
<cfloop query="qryParAddress">
<cfloop collection=#qryParAddress# item="currStudent">
<cfif len(trim(StructFind(qryParAddress, currStudent)))>
<cfset qryParAddress[currStudent] =
Trim(qryParAddress[currStudent])>
</cfloop>
</cfloop>
I'm concerned only about the <cfloop> part. Just assume the <cfquery> is all
fine. (This is not the query I'm actually using, and I'm certainly not
actually doing a SELECT *)
Please don't suggest a long list of individual field names being trimmed.
There are too many of them.
Its a CFC being called from flash, so debugging info is minimal. This is the
error it gave back to the flash net connection debugger:
....description: "Service threw an exception during method invocation: null"
.....details: "Service threw an exception during method invocation:
null:java.lang.UnsupportedOperationException:java.lang.UnsupportedOperationE
xception
Can anyone see the error in what I'm doing?
Regards
Darren Tracey
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/