Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error checking

Status
Not open for further replies.

yuchieh

MIS
Jul 21, 2000
178
US
I need to check if the database server is down (our server has been flaky), then stop the insert process (coded in Cold Fusion).

How do I check the server?

Thanks
 
We do something like this:
Code:
<cftry>
   <cfquery name=&quot;avail&quot; datasource=&quot;DSN&quot;>
      SELECT 1 FROM DUAL
   </cfquery>
   <cfcatch type=&quot;database&quot;>
      do something because we didn't connect
   </cfcatch>
</cftry>

It works very nicely.
 
I have more than one insert query. Do I do this?

<cftry>
insert query1
insert query2
insert query3

<cfcatch type=&quot;database&quot;>
Do something here
</cfcatch>

</cftry>


Thanks for the reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top