ColdFusion 11 and dbvarname attribute

First, some background.

dbvarname is an attribute for cfprocparam to specify named parameters while calling a stored procedure. For details refer

Versions prior to ColdFusion5 had support for dbvarname. This was deprecated in ColdFusion MX, brought back in 7.0.1 and deprecated again in 7.0.2. The reason was the lack of proper support from multiple jdbc drivers. Since then, this was a major ask among ColdFusion users.

ColdFusion 11 brought this attribute back from the dead. It was disabled by default with a flag to enable it. ColdFusion 11 update 3 enabled it by default. Databases need a variable prefix for named parameters. (eg:- “:” for Oracle and “@” for SQLServer). If the database is SQLServer, it should be dbvarname = “@param1”. This will break applications which were using this attribute without the prefix because this attribute was being completely ignored in prior versions. So to give some time for customers who don’t want to change their code, in update 4 we introduced a flag to disable dbvarname.

-Dcoldfusion.ignoredbvarname=true jvm flag can be used to disable dbvarname attribute. This flag is only for CF11 and not for later versions.

Having to change lot of code is not pleasant but we believe that is the way forward.

5 thoughts on “ColdFusion 11 and dbvarname attribute

  1. Folks on CF11 (or moving from 10 or earlier) should note that last point: that the JVM arg “workaround” is NOT carried forward into CF2016. If moving to that release you MUST change your code, if you use dbvarname and find that now such code fails. Again, see above for the typical changes that are required.

    I do wonder if Adobe may change their stance on this. I had raised that and the point I make above in a previous comment here, but it was lost (along with may others of my comments on dozens of posts here) in the move to the new Adobe blog platform.

  2. So I am using Informix as one of the databases that supports my CF 2016 application. The issue I have is that I have no idea what prefix should be used as a variable prefix. Could you please answer this question for me? (using the JDBC driver from IBM)

Leave a Reply

Your email address will not be published. Required fields are marked *