I am trying to do a cfcatch, but I have a cflocation which is supposed to work only if there is no error. I tried several cfif statements, but I seem to be messing up the logic and syntax a lot! Could someone at least show me some psuedo code so I have a good idea how I should be doing this, or if I am way off base with the way I am trying to handle the error?
I appreciate any time taken!
Va.
<cftry>
<cfquery datasource="cficapps">
update
C3SYS.C3_TEAMMEMBERSHIP_TBL
set
empid='#form.empid#',
level1='#form.level1#',
level2='#form.level2#',
level3='#form.level3#',
level1rank='#form.level1rank#'
where
empid='#URL.empid#' AND
level1='#URL.level1#' AND
level2='#URL.level2#' AND
level3='#URL.level3#' AND
level1rank='#URL.level1rank#'
</cfquery>
<cfcatch type="database">
<cfoutput><font face="Verdana, Arial, Helvetica, sans-serif">
<h3><p>You are trying to create a duplicate record.</p></h3>
<p>Click <a href="Search.cfm">here</a> to return to Search page. <br/>
Click <a href="Menu.cfm">here</a> to return to Main Menu.</p>
</font></cfoutput>
</cfcatch></cftry>
<cflocation url="Search.cfm">
I appreciate any time taken!
Va.
<cftry>
<cfquery datasource="cficapps">
update
C3SYS.C3_TEAMMEMBERSHIP_TBL
set
empid='#form.empid#',
level1='#form.level1#',
level2='#form.level2#',
level3='#form.level3#',
level1rank='#form.level1rank#'
where
empid='#URL.empid#' AND
level1='#URL.level1#' AND
level2='#URL.level2#' AND
level3='#URL.level3#' AND
level1rank='#URL.level1rank#'
</cfquery>
<cfcatch type="database">
<cfoutput><font face="Verdana, Arial, Helvetica, sans-serif">
<h3><p>You are trying to create a duplicate record.</p></h3>
<p>Click <a href="Search.cfm">here</a> to return to Search page. <br/>
Click <a href="Menu.cfm">here</a> to return to Main Menu.</p>
</font></cfoutput>
</cfcatch></cftry>
<cflocation url="Search.cfm">