| By Charlie Arehart | Article Rating: |
|
| September 17, 2003 12:00 AM EDT | Reads: |
6,991 |
It may be hard to believe, but there are times when you should pay careful attention to case (use of upper and lower case letters) when spelling the datasource name in a CFQUERY tag. Case sensitivity is a common issue in Unix environments, but there is an issue that can arise unexpectedly in Windows environments.
If you issue an updating statement (SQL INSERT, UPDATE, or Delete) or CFUPDATE/CFINSERT tag in one template and use CFLOCATION to go to another template to do a query against the same datasource to displays the record(s) you just updated, and the case of the datasource names in the two templates does not match, the updates won't be reflected on that next page's query results until it is refreshed. It's true! The record is indeed updated as expected, but for some reason the results are not depicted until the page is refreshed. (A previous version of this tip said the case must match the name of the datasource as defined in the administrator, but I've since learned that it's just a question of them matching each other on the two pages.)
In an example application, simply changing the case of the datasource name of the two templates to match each other solved the problem. Allaire has recognized the problem but has no solution as yet.
Charlie Arehart Education Director, Fig Leaf Software
Published September 17, 2003 Reads 6,991
Copyright © 2003 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Charlie Arehart
A veteran ColdFusion developer since 1997, Charlie Arehart is a long-time contributor to the community and a recognized Adobe Community Expert. He's a certified Advanced CF Developer and Instructor for CF 4/5/6/7 and served as tech editor of CFDJ until 2003. Now an independent contractor (carehart.org) living in Alpharetta, GA, Charlie provides high-level troubleshooting/tuning assistance and training/mentoring for CF teams. He helps run the Online ColdFusion Meetup (coldfusionmeetup.com, an online CF user group), is a contributor to the CF8 WACK books by Ben Forta, and is frequently invited to speak at developer conferences and user groups worldwide.
- Validating Input with Regular Expressions
- Getting Focus()ed and a Quick JavaScript Lesson
- Setting Up Your Development Server with ColdFusion 5, MX, and BlueDragon
- Toward Better Error Handling
- Monitoring Your ColdFusion Environment With the Free Log Parser Toolkit
- New Possibilities for Session/Client Variable Handling in CFMX
- Testing Existence in Arrays
- Making the Case for CFML on J2EE
- Exploring Amazon Web Services with ColdFusion MX
- Getting Focused - and a Quick JavaScript Lesson
- CFML on J2EE: Easy as 1-2-3
- Getting into HomeSite+



























