Ask a Question related to Coldfusion Database Access, Design and Development.
-
DickBobUK #1
Rename Query Column Name
I know I can rename the column in the db by using AS, but I don't have those
priv's and I've got some really ugly column names which I'd like to rename to
something nicer when I CFQUERY the data into a record set. Thoughts anyone?
DickBobUK Guest
-
Query by column name & output
Hi I have a lot of column names that have a value of 1 or 0. HasRadio 1 BarLounge 0 IndoorPool 1 etc etc. I am thinking of the best way to query... -
Column width query
Sorry this is a repost: Hi, I am wanting to display data in a datagrid with additional header rows above it that categorise some of the main... -
how to query a column name with special character
i was able to create a table with a column name abc\ on db2 v8.1 on windows, but when i do the query select abc\ from table, i get error '\' is... -
Sum a column of values from a MySQL query
I am trying to sum a query of values from a MySQL table. The code I am using is: ---BEGIN CODE #1-------------- $sql_2 = "SELECT... -
how to add another column to a query result?
hi guys, I have a query that will return 4 record with 1 column. I want to add another "title" column for the four record. The query is design so... -
TA-Selene #2
Re: Rename Query Column Name
If you are writing the query using CFQUERY then you can use AS to create an alias for the column names.
TA-Selene Guest
-
DickBobUK #3
Re: Rename Query Column Name
Sorry, I shoud have been more clear.
I'm calling a stored procedure so I can't rename the columns using AS in CFQUERY.
DickBobUK Guest
-
kyle969 #4
Re: Rename Query Column Name
Use query of query.
<cfstoredproc result="qResult" ... />
<cfquery dbType="query">
SELECT ReallyLongAndUglyColumnNameLikeThis as newCol1
FROM qResult
</cfquery>
kyle969 Guest
-
kyle969 #5
Re: Rename Query Column Name
If the column names are much longer than the data values and it is a large
resultset you should recomend changing them to the DBA. If the record is 20
bytes and the column names are 256 bytes, each record is sent over the network
as 256 bytes, the execution time would be greatly improved if the column names
were smaller.
kyle969 Guest
-
DickBobUK #6
Re: Rename Query Column Name
Thanks for your comments Kyle. I was trying to avoid the processing/memory of
doing a query of query, but I guess it's the only way. Good point you raised
about the overhead of long column names. I hadn't thought of that before!
DickBobUK Guest



Reply With Quote

