John Beynon

Confessions of a code Junkie and anything else i fancy!

CF8 – dbvarname supported or not?

A question arose in the Adobe ColdFusion forums as to whether or not CF8 supported named attributes (dbvarname) with CFPROCPARAM. There’s been a little confusion regarding using named parameters since CF5 supported them, CF6 dropped them, CF7 didn’t include them but then hotfix 7.0.2 added support for them which was then updated 1 day later with support removed.

CF8, now using JDBC 3.0 had initial support for dbvarname in early betas but then was removed in the final release. However, you still see occasional suggestions that dbvarname may be still support, indeed – if you’ve seen any of Charlie Areharts CF8 Hidden Gems presentation he has it listed and the odd code sample that pop up in the ether eludes to it being supported so i thought I’d try it out for my self…

So, i took a really simple SP call and started playing with it;








and then modified it to use dbvarname attributes as per samples floating around…









sure enough it worked – but that’s not a real test since the procparams are still in the same order as the SP parameters – sure enough, changing them around caused the SP call to break!









So in conclusion it appears that named parameters with stored procedure calls on CF8 IS NOT SUPPORTED!

No related posts.

Tagged as:

7 Comments

  1. I can not remember where I saw it, but it was documented somewhere that it is not longer supported. Nothing wrong with positional arguments…Just make sure they are nullable in your proc and add the null="#not len(varName)#" trick and you’ll be fine :)

  2. That’s correct, the use of dbvarname and its named notation of SP parameters is not supported in any ColdFusion release since CF5. An significant engineering effort went into trying to add it back to CF8, but in the end the behavior wasn’t perfect and it was pulled.

  3. I’m actually hoping that if they ever do start supporting it again, it’s feature that can be toggled off/on. We use the dbvarname in our code, but strictly for documentation purposes. The problem is the names might not match exactly in some cases. Since it doesn’t currently work, if there’s any kind of spelling mistake, it wouldn’t show up until the feature actually starts working. So, I hope it’s an option that can be turned off/on if Adobe does actually decide to turn it on again.

  4. Hey John, I was piqued by your title when I saw it on FullAsAGoog, as indeed it’s an issue near and dear to my heart. You’re right that I did include it in my talk, because I’d seen reference to it elsewhere. I just hadn’t yet tried it. When I did a few weeks ago, and learned it was no longer there, I pulled it from the talk. Shame to see that it was. I’ve had some people confide over the years that they have code from CF5 where the volume of changes needed to get it to work without DBVarName has been enough that they’ve been reluctant to upgrade. It’s a shame. As Dan says, perhaps the best solution is an option to enable/disable it per DSN or per app (as opposed to an attribute of CFSTOREDPROC, which again would require change to the code.)

  5. FWIW – didn’t you have to use @varname for it to work anyways? I always forget…

  6. I have noticed that CF8 still notices the attribute because if you have it on some but not all parameters in the proc, it throws an error saying that you have to use it for all or none.

  7. I can confirm that CF8 will throw errors if some and not all parameters have dbvarname specified.
    This was the only issue I had when upgrading my apps from CF7 to CF8. I found the documentation lacking. (Enterprise version, Windows).

Leave a Response