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.

7 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)

  3. The variable prefix for Informix is nothing. The setup for Informix is different and when I was able to get it configured via the ColdFusion admin page, I found that there are two separate methods that work to connect.

    ODBC Socket: Using the Informix SDK installation from IBM permits you to create a 64 bit System DSN via the odbcad32.exe from your system32 folder in your operating system installation. While this is not a preferred method of setup because you are using the OS as a middle man, if all else fails, use this method.

    Working with Adobe Support they offered another method of connecting:
    Data & Services > Datasources > Other
    JDBC URL: jdbc:macromedia:informix://:;informixServer=;DatabaseName=;jdbcbehavior=0

    I guess the old driver is still out there in the 2016 installation of CF Server and this is how you can access/use it. I hope this helps someone else out there!

  4. Note that when I use dbvarname to specify a specific variable when calling a stored process, I use dbvarname=”variablename” and note that there are no special prefixes or characters. Also note that with Microsoft SQL I was forced to use an @ Symbol as a prefix (and if I read through my stored processes, each parameter that is used in call to the process has an @ Symbol preceding it)

Leave a Reply

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