Skip to main content
Inspiring
November 9, 2011
Question

computed_column_x

  • November 9, 2011
  • 1 reply
  • 988 views

What does it mean when i get back computed_column_1, computed_column_2 etc instead of actual column names in a query? im not doing anything fancy in the SQL

in this case, this is using a custom odbc driver called ezRets that is designed to comunicate with a RETS server and translate it back to a psudo database query so im

sure it's doing a lot of stuff behind the scenes. Is there anything i can do about this? My work around is doing of a query of query with select computed_column_x as "actual column name"

which works cause the number of x is the same as the order i selected the actual column names in the original query. I can't do the AS in the original query since it's not supported

by the ezRets ODBC driver.

I guess it's not a huge deal in this case to do the query of query workaround but i was wondering if anybody had an insight on the computed_column thing.

This topic has been closed for replies.

1 reply

Inspiring
November 10, 2011

What does it mean when i get back computed_column_1, computed_column_2 etc instead

of actual column names in a query?

I cannot speak for RETS, but in a regular query that happens when you

return some sort of calculated column without supplying an alias. One

example is using an aggregate function like SUM() without aliasing int.

Since you need some way to access the results, CF assigns a generated

column name: computed_column_x. 

the number of x is the same as the order i selected the actual column names in the original query

You could loop from 1 to x and access the data with associative array

notation ie   #queryName["computed_column_"& counter][rowNumber]#.  Though it does not make for the most intuitive code .. Since I am not familiar with RETS, that is the only

option I can think of aside from a QoQ.

Leigh

zeejayyAuthor
Inspiring
November 10, 2011

Yeah thas pretty much what i thought, i guess theres probably nothing i can do since the ODBC driver is returning the columns

in a way that CF needs to assign computed column names to them. It's not supprising since it's not actualy querying

a database but instead going out to a RETS webservice and then putting together all the info into a psudo ODBC connection and query result.

Even with my workaround it's still much easier then dealing RETS directly.

Inspiring
November 10, 2011

Just out of curiosity, what results do you get if you query the ODBC connection directly from another application?

 

-Leigh