I am trying to loop over some values to insert data into a DB using ColdFusion ORM.
I am having issues getting the syntax right. Here is an example of what I am trying to do:
<cfscript>
var tn = 'CompanyName';
transaction{
newComp = EntityNew("company");
newComp.set & tn &('ABC Comp');
EntitySave(newComp);
}
</cfscript>
For simplicity of this question I am just using a single variable. The actual code loops through an array of data but if I can just figure out how to do it with a variable I can handle the rest.
I have tried a bunch of ways of doing this but I cannot get the syntax right.
Is this possible?
Any help would be great.
Thanks in advance.
Try