Managed to determine that the problem isn't with this function (which is
actually much simpler than it first seems), but that the problem is with the
dbproc/arguments used.
Once I'd solved that problem, the rename started working as it should.
>Hi,
>
>I've got a problem with the following function, which seems to have
>been caused by upgrading to CFMX7 - it is now only returning an empty
>query with a single "COL_NAMES" column, rather than a proper set of
>data.
>
>The "theQuery" variable is the result of an Ingres stored procedure.
>The purpose of the function being to turn the results columns from
>that procedure into CF-compatible names.
>
>I'm hoping that someone here can either provide a fix for the
>function, or point out an alternative method (that obviously results
>in the same output).
>
>Here's the function:
>~~~
><cfscript>
> //Map columns UDF...
> function mapColumns(theQuery) {
> //Declare local vars
> var realColumnList = "";
> var columnNamesList = "";
> var columnNamesArray = "";
>
> //Get the real column names based on the first row/column of
> result set...
> realColumnList = theQuery["RESULT ELEMENT0"][1];
> //Prepend a dummy column name for the first column
> realColumnList = listPrepend(realColumnList,"COL_NAMES");
> //Create a String object with our new column names...
> columnNamesList = createObject("java","java.lang.String");
> columnNamesList.init(realColumnList.toString());
> //Convert to a String Array!
> columnNamesArray = columnNamesList.split(",");
> //Change the column names of the result set using the array!
> theQuery.setColumnNames(columnNamesArray);
> return true;
> }
></cfscript>
>~~~
>
>Thanks for any help.
>
>Peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:205499
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54