Search code examples
coldfusioncoldfusion-9cfquery

Dynamically adding column


Sometimes I need to add a column to an empty table

if (listfind(arguments.config[3], "payout"))    {
    QueryAddColumn(local.qryResult, "payout", "cf_sql_float");
    }

I get an error that looks like

enter image description here

It seems to want a java.util.List

Isn't "cf_sql_float" a single element list?


Solution

  • The documentation is your guide. You need an array name. I always use arrayNew(). This should do the trick.

    QueryAddColumn(local.qryResult, "payout", "cf_sql_double", arrayNew(1));