I have the following code:
<cfquery name="somequery1" datasource="somedsn">
SELECT somecolumn1, somecolumn2, somecolumn3
FROM sometable
WHERE someid = <cfqueryparam cfsqltype="cf_sql_integer" value="1">
</cfquery>
<cfquery name="somequery2" dbtype="query">
SELECT *
FROM somequery1
</cfquery>
My code manager says I need to change the Query of Query to:
<cfquery name="somequery2" dbtype="query">
SELECT somecolumn1, somecolumn2, somecolumn3
FROM somequery1
</cfquery>
Can someone explain why I would need to redefine the column references in the Query of Query? Surely, the wildcard operator takes care of this.
Is there any technical or performance gain to redefining the column references in the SELECT clause of a Coldfusion Query of Queries? This assumes that the column references have already been explicitly set in the database query that is supplied to the Query of Queries.
I believe the use of the wildcard operator makes the code cleaner and easier to update, because any changes to the column references only need to be done once.