286
</cftransaction>
</cftry>
</body>
</html>
<cfquery name = 'insertNewCourseToList' dataSource = 'cfsnippets'>
INSERT INTO CourseList
(CorNumber, CorDesc, Dept_ID,
CorName, CorLevel, LastUpdate)
VALUES
('#myNumber#', '#myDescription#', '#myDepartment#',
'#myDescription#', '#myCorLevel#', #Now()#)
</cfquery>
<!------------------------------------------------------------------
Rolls back the pending insertion if database exception is caught.
------------------------------------------------------------------->
<cfcatch type = "DATABASE">
<cftransaction action = "rollback"/>
<cfset commitIt = "No">
</cfcatch>
<cfif commitIt>
<cftransaction action = "commit"/>
<!--------------------------------------------------------------
Commits the pending insertion.
---------------------------------------------------------------->
<cfelse>
<cfset commitIt = "Yes">
</cfif>
Chapter 2 ColdFusion Tags
Need help?
Do you have a question about the COLDFUSION 5 - CFML and is the answer not in the manual?