If the database field is varchar, then you are using the correct cfsqltype.
This sounds more like CF lost it's cache of the query ("Could not find
prepared statement with handle 2") and couldn't rebuild, but I thought that
CF wouldn't cache queries that use cfqueryparam. Hmmm...Cheers, Kris On 4/10/07, Peterson, Chris <[EMAIL PROTECTED]> wrote: > > The reportnumber technically is a varchar containing a number (URL vars > are typless arent they?) and the database field is a varchar. Why would > this happen today and not in the past 4 years? > > Chris > > -----Original Message----- > From: Adkins, Randy [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 10, 2007 7:57 AM > To: CF-Talk > Subject: RE: Could not find prepared statement with handle 2 - suddenly? > > My guess is that Reportnumber is an INTEGER field but the CFQUERYPARAM > you are specifying indicates a VARCHAR field. > > > -----Original Message----- > From: Peterson, Chris [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 10, 2007 7:43 AM > To: CF-Talk > Subject: Could not find prepared statement with handle 2 - suddenly? > > Making no code or server changes (that I know of), this morning an > application that I have had going for 4 years+ started throwing this > error: > > Could not find prepared statement with handle 2 > > I tracked it down to this pretty simple query here: > > <cfquery name="getReportInformation" datasource="Reports"> SELECT * FROM > runReports WHERE Reportnumber = <cfqueryparam cfsqltype="cf_sql_varchar" > value="#trim(url.report)#"> > </cfquery> > > I removed the cfqueryparam, and it starts working perfectly. Why would > this break all the suddon? Any idea's? > > > > Chris Peterson > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Macromedia ColdFusion MX7 Upgrade to MX7 & experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274928 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

