Ok now that I can see what you are doing, here is what I would do. In the code that creates the query, if the relationship is empty then you could write the code there to do the check and set it to the value you want, and then return the query. Hell if you wanted better performance you can even get the SQL code to do the job for you.
This would eliminate the need to do a cfparam and isdefined, as it will always exist. Just something you might want to consider, and the reason I say that is you are putting too much emphasis on the fact that anything else using this code needs to do extra checking. By moving that checking into the code with the query, you promote better code reuse and you remove the dependency of any other code that might need to call this, because the assumption is that it will always be there regardless, which is what you are trying to do. Btw there is no difference between the isDefined() and structKeyExists() except that the latter is actually much faster to execute, if you read the docs they both do the same thing, only one is faster. Regards, Andrew Scott http://www.andyscott.id.au/ > -----Original Message----- > From: Robert Harrison [mailto:[email protected]] > Sent: Friday, 1 July 2011 5:57 AM > To: cf-talk > Subject: RE: Stupid Question > > > > Out of curiosity, what condition was your cfparam trying to prevent? > > The URL structure works like this: > > http://blah-blad.com/services-detail.cfm/bariatric-and-wellness > (which is a high level overview category record only) > > or http://blah-blad.com/services-detail.cfm/bariatric-and- > wellness/treatment-options (which adds more specific detail to the page > about treatment options) > > If it's a high level page the query retrieves the category record only. If it's a > more detailed page the query also joins in another table to get the additional > detail requested, so values from the detail table may not always exists in the > returned query. > > > The cfparam tag was trying to set default values (like zero) for columns that > may not always be returned from the query. That did not work, but the > IsDefined did work. > > I'm not done with the page, but you can get the idea at: > http://68.168.221.45/services-detail.cfm/breast-health/breast- > reconstruction . The left navigation, main lookup and detail lookups are > working. Still writing the code to chain in the related FAQs, events, and staff. > The change based on the service selected. > > > Robert B. Harrison > Director of Interactive Services > Austin & Williams > 125 Kennedy Drive, Suite 100 > Hauppauge NY 11788 > P : 631.231.6600 Ext. 119 > F : 631.434.7022 > http://www.austin-williams.com > > Great advertising can't be either/or. It must be &. > > Plug in to our blog: A&W Unplugged > http://www.austin-williams.com/unplugged > > > -----Original Message----- > From: Leigh [mailto:[email protected]] > Sent: Thursday, June 30, 2011 3:38 PM > To: cf-talk > Subject: RE: Stupid Question > > > > capability_detail is a query. > > It returns one and only one record... > > Out of curiosity, what condition was your cfparam trying to prevent? > > 1) query contained 0 records > 2) query did _not_ contain the column "capability_id" > .. > ? > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~~~~~~~~~| > Order the Adobe Coldfusion Anthology now! > http://www.amazon.com/Adobe-Coldfusion- > Anthology/dp/1430272155/?tag=houseoffusion > Archive: http://www.houseoffusion.com/groups/cf- > talk/message.cfm/messageid:346000 > Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm > Unsubscribe: http://www.houseoffusion.com/groups/cf- > talk/unsubscribe.cfm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346019 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

