Dave Phillips wrote: > (Claude) >> It may be a silly question, but why a SELECT * will brake > because an unused column was dropped? > > To clarify, it is a SELECT * query with a CFQUERYPARAM in it. Because the > first time the query is executed, an execution plan is built and cached. > That execution plan extrapolates all the columns from the table since the * > was used. Now, once the query is executed once, drop a column from the > table and run the query again. It will fail because the column it is trying > to reference (through the cached execution plan) is no longer there.
To clarify the clarification, an execution plan is *always* built, whether the SQL uses the best practice of <cfqueryparam...> or not. Without the <cfqueryparam...> many more execution plans may be generated depending on the nature of the queries and the application the live in and its usage. Thus these non-queryparam plans can easily be pushed out the cache faster and thus the problem described will live for a shorter time. But it can happen either way. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309663 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

