当前位置: 代码迷 >> ColdFusion >> 帮小弟我看看这段代码有什么东东?谢谢了!
  详细解决方案

帮小弟我看看这段代码有什么东东?谢谢了!

热度:9165   发布时间:2013-02-26 00:00:00.0
帮我看看这段代码有什么错误?????多谢了!!!!!!!!!
<cftry>
<cfset commitIt="yes">
<cftransaction action="begin">
<cfquery name="del_c" datasource="province">
delete from city where provinceID='#FORM.provinceID#'
</cfquery>
<cfquery name="del" datasource="province">
delete from province where provinceID='#FORM.provinceID#'
</cfquery>
<cfcatch type="database">
<cftransaction action="rollback">
<cfset commitIt="no">
</cfcatch>
<cfif commitIt>
<cftransaction action="commit">
<cfelse>
<cfset commitIt="yes">
</cfif>
</cftransaction>
</cftry>

------解决方案--------------------------------------------------------
<cftry>
<cfset commitIt="yes">
<cftransaction>
<cfquery name="del_c" datasource="province">
delete from city where provinceID='#FORM.provinceID#'
</cfquery>
<cfquery name="del" datasource="province">
delete from province where provinceID='#FORM.provinceID#'
</cfquery>
</cftransaction>
<cfcatch>
<cfset commitIt="no">
</cfcatch>
</cftry>
  相关解决方案