Rick Root wrote:
> I'm just going to vent to the list here for a second.
>
> This is a bug that I'vek now about for a while, and have reported to
> adobe several times, but I haven't bothered to verify its existence in
> Coldfusion 7 since we haven't beeing using hte DB2 JDBC drivers until
> recently.
>
> Consider the following coldfusion code:
>
> <cfquery name="qry2" datasource="DSNa" maxrows="1">
> select TABLKEY AS USERID, TABLFLD AS FULLNAME
> from ADUADS01.TMOTB905
> WHERE TABLKEY='ADSRJR'
> </cfquery>
> <cfdump var="#qry2#">
> <cfdump var="#getMetaData(qry2)#">
>
> The column names returned by this query are "TABLKEY" and "TABLFLD"
i've solved this problem! After 3 years or frustration and avoiding
general use of DB2 via JDBC.
Our mainframe application was a "packaged" application ("ADVANCE" from
BSR). The original table designs included column labels. Like "Foreign
code" when the column name was "FORGNCOD"
3-4 years ago when we first migrated to CFMX and attempted to use the
JDBC drivers, we noticed the issue, and updated all of the column labels
to be equal to the column names. Which solved a large part of the
problem, but never did fix the aliasing problem. The inability to alias
columns was a dealbreaker, and we ended up going with ODBC using
DB2/Connect.
Years have past, and I really want to get rid of DB2/Connect, so I
started investigating the whole issue again.
I tried aliasing a function, because computed columns don't have names
OR labels.... so I did "select coalesce(ENTITYID,'') AS EID ..." and
that worked. And that became my "workaround solution".. I could use
CHAR() or COALESCE() pretty much anywhere, so I could get around the
issue by using these functions when I needed to alias a column.
But that led me to wonder about the lack of column labels, so I looked
at our database schema, and tried to alias a column in a table that had
no labels.. and it worked!
Turns out, column aliasing works fine - AS LONG AS THE COLUMN DOESN'T
HAVE A LABEL. (sysibm.syscolumns -> label)
So my solution - wipe out the column labels, and POOF! Everything works.
**************************************************
It's worth noting that if Adobe didn't use the JDBC
getColumnLabels() instead of getColumnNames() none
of this would be a problem.
**************************************************
Rick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254686
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4