by Kay Smoljak
Noteworthy threads from the famous ColdFusion-Talk (CF-Talk) List on House of Fusion for the Week of April 28 - May 2, 2008
Daniel Kessler wondered why his test CFMAIL message was not being delivered. Six Coldfusion-Talk subscribers gave troubleshooting suggestions, and the thread is a useful checklist for the causes of the most common CFMAIL problems. Daniel's problem went away when he removed the server attribute of the CFMAIL tag. This means that the default mail server setting in the CFAdministrator (which he did not have access to) was correct, and the mail server that he was specifying to override that setting was incorrect.
Thread: Compare digits as strings not integers
Ian Skinner wanted to compare two strings of digits as characters rather than numbers. Claude Schneegans, Sonny Savage and Axel Schultze suggested comparing both value and length, with the Compare(), CompareNoCase(), and Len() functions. Bobby Hartsfield and Dave Watts suggested adding a non-numeric value to the strings and then comparing them. Ian reported back that the Compare() function gave him the result he needed.
Thread: Need some advice on speeding up query
Rick Faircloth wanted to speed up a large multi-table UNION query, and was looking for confirmation that adding indexes would help. Using Rick's supplied query, Rizal Firmansyah suggested the addition of keys on a number of fields, and using UNION ALL instead of UNION. Rick implemented the changes and reported that he was amazed at the effectiveness. James Holmes also offered some advice on the efficiency of the table structure.
The thread then evolved into a discussion of how best to implement paging for the records, given that the data structure was not optimal. Dominic Watson provided a solution that involved "injecting"
a fixed value into each part of the union in place of a proper key, which Rick was able to implement. Mary Jo Sminkey then provided some alternatives for caching the query: using the cachedwithin attribute of the CFQUERY tag, storing it in an application variable, or making use of CFTHREAD.
Thread: Is this Application cfm abuse?
John Engstrom was surprised to find that when he dumped the application scope of a project he was working on, there were over 25,000 lines of variables and struct items. John wanted to know if that many variables in the application scope qualified as "application.cfm abuse"
.
A handful of listers weighed in on the topic, with responses ranging from "perhaps a little"
to "not at all"
, but with most of the opinion that it would depend on the application and how it was structured.
Thread: Printing Database Structure
Steve Good was looking for a way to print tables names, column names and datatypes from SQL Server Management Studio. Marco Antonio supplied the SQL statement that Steve was looking for, but some other list members suggested SQL Server's built-in diagram tools, the DataMgr project on RIAForge, and CF8's built-in CFDBINFO tag.
Thread: problems with cflocation and redirect will never complete
Casey Dougall was having a problem with a script which was incrementally creating an XML file. After each row, the script would use cflocation to call itself again and find the next row to output. After a certain number of iterations, the browser was halting the request, as it thought it had hit an infinite loop.
Several potential solutions were raised – using Java redirects or increasing the script timeout – but these weren't taking into account that the problem was occurring in the browser, not on the server. Dominic Watson offered a solution using CFHTTP, and Dave Watts suggested either an asynchronous solution, or the use of meta refreshes in the browser.
Kay is an all-round web developer who has been developing with ColdFusion since 2000. She runs Clever Starfish with her partner Dave and several very demanding cats, and sits on the committee of the Australian Web Industry Association. She is a regular writer for Fusion Authority and the Fusion Authority Quarterly Update, and a ColdFusion blogger on Sitepoint.com.