Yesterday, I was talking to Angel Gonzalez about an interesting use-case in ColdFusion - something that I’ve never personally tried before - evaluating database records that contain ColdFusion Expressions. Specifically, database records that contain String interpolation in which the interpolated value is being pulled out of the current ColdFusion request. I’m always curious to see how the CFML runtime can be used to unique ways; so, I thought I would try this out for myself.

The idea here is that the database record would contain a varchar value like:

_Hello, #name#_

… in which the dynamic name value would be pulled out of the ColdFusion request at runtime and interpolated as part of a dynamic evaluation.

In ColdFusion, we can use the evaluate() function to execute “stringified” ColdFusion code. Which usually goes hand-in-hand with the de() function for “Delayed Evaluation”. So, to try this out, I created an in-memory Query object and then ran it through the evaluate() function:

#coldfusion #expressions #adobe coldfusion #evaluating database

Evaluating Database Records That Contain Interpolation Expressions
1.10 GEEK