5 Replies Latest reply on Oct 5, 2007 12:00 AM by Newsgroup_User

    queryAddColumn

      I am having a problem getting this function to work in cf7. My test code is:

      <cfset test=queryNew("col1")>
      <cfset queryAddColumn(test,"col2","varChar")>
      <cfdump var="#test#">

      The result is the following error:

      Parameter validation error for function QUERYADDCOLUMN.
      The value of the parameter 3, which is currently "varChar", must be a interface java.util.List value.

      I'm sure it's something dumb, but any help would be much appreciated

      Thanks
      Fred

        • 1. Re: queryAddColumn
          paross1 Level 2
          Looks like you are missing the array-name. The datatype is optional, so since you have only 3 parameters to this function call, the assumption is that the 3rd parameter would be an array-name.

          Syntax: QueryAddColumn(query, column-name[, datatype], array-name)

          Phil
          • 2. Re: queryAddColumn
            I would like to add the column without populating it. Is this possible?

            Thanks
            Fred
            • 3. Re: queryAddColumn
              cf_dev2 Level 1
              Add it in the queryNew() statement or pass in an empty array (ie ArrayNew())

              1 person found this helpful
              • 4. Re: queryAddColumn
                Dan Bracuk Level 5
                quote:

                Originally posted by: timeToPlay
                I would like to add the column without populating it. Is this possible?

                Thanks
                Fred

                The easiest way is to have the column in the first place. Assuming the query is coming from a db, select a constant, give it an alias, and there's your column.
                1 person found this helpful
                • 5. Re: queryAddColumn
                  Level 7
                  It's brilliant. It's simple. It's simply brilliant.

                  Cheers Dan.

                  "Dan Bracuk" <webforumsuser@macromedia.com> wrote in message
                  news:fe4bgl$te$1@forums.macromedia.com...
                  >
                  quote:

                  Originally posted by: timeToPlay
                  > I would like to add the column without populating it. Is this possible?
                  >
                  > Thanks
                  > Fred

                  > The easiest way is to have the column in the first place. Assuming the
                  > query
                  > is coming from a db, select a constant, give it an alias, and there's your
                  > column.
                  >
                  >


                  1 person found this helpful