> I have a temporary table that needs to be deleted after 
> processing has completed. But, if the user bails and doesn't 
> complete the transaction, the temporary table doesn't get deleted,
> which causes an error message when CF attempts to create the 
> table later on. So I put in some code to delete the table before 
> it's created, but if it doesn't exist, I get an error
> message. I tried to test for the existence of the table, but I 
> guess this isn't the way to do it:
> 
>   <cfif #IsDefined(EDGE.dbo.Temp)#>
>       <CFQUERY DATASOURCE="EDGE" DBTYPE="ODBC">
>            DROP TABLE temp
>       </CFQUERY>
>  </cfif>

To expand on the CFCatch route;

<cftry>
        <CFQUERY DATASOURCE="EDGE" DBTYPE="ODBC">
                DROP TABLE temp
        </CFQUERY>      
        <cfcatch>
        </cfcatch>
</cftry>

This will not puke if the drop table fails.

HTH

Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they 
are addressed. If you have received this email in error please notify 
the system manager.
**********************************************************************


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to