I have to give some props to the Adobe CF team. Yesterday I reported a bug in CF8 via the Adobe bug report/feature request form. In a nutshell:
There is a change in behaviour between CF6/7 and CF8 with CFQUERY's NAME attribute. The earlier versions allow the empty string to be passed, but CF8 didn't (it raises an exception). The documentation (for all versions) states that the value must begin with a letter and that the attribute is required. Clearly the latter statement is false. The former could be interpreted to imply that the empty string is invalid, depending on whether you consider the empty string to have a beginning character. My complaint wasn't with the docs however, just the break in backwards compatibility.
Within a few minutes of submission I'd received a emails from Tim Buntel and Damon Cooper to get clarifications and example code. Today, via the forum thread they requested I start, Tom Jordahl said the bug will be fixed. So bravo for the remarkable responsiveness; I have to admit I wasn't really expecting a fix in the CF8 series, let alone almost immediately.
I never hear back from bug submissions (pout pout pout) :)
This is a strange "bug". I had never even though of leaving the name attribute blank. I only came across that for the first time a few months ago. I like to use the query name attribute because I feel that it gives one more piece of documentation as to what is going on:
….
I know this query is deleting join relationships to whatever main item I am viewing, and the name allows me to do this without even looking at the query content.
Just a personal preference.
Regardless, that is awesome that Adobe got right on top of it. Just another reason they rock :D
The main source of empty CFQUERY NAME attributes is generated code. I use a snippet in CFEclipse for creating ad hoc CFQUERY tags, and it has a dialog with a 'name' field. For queries that don't return a result set, I just leave it blank.
I also generate a fair amount of CFML (mostly data access CFCs), and I have routines that assemble my queries, and they do much the same thing: if no name for the query is required, it just leaves it as the empty string, rather than adding logic to remove the empty NAME attribute.
With large-scale generation, I do more static generation than dynamic generation, which means all the code I've already generated is developer-edited, not regenerated. The dynamic stuff is easy, just update the generator and regenerate.