I have an AS/400 and I am not sure if it supports transactions and I
want to test it. Is the syntax for cftransaction correct below. I would like
to pretend there is an error right after I insert the newlinenumber and I
would like to roll that back.


<cftransaction action="BEGIN">
        <cfquery name="GetNextNumber" datasource="#request.AS400dsn#"
dbtype="ODBC">
                SELECT  #request.enviroment_exception#.F0002.NNN002 as Next
                FROM #request.enviroment_exception#.F0002
                WHERE #request.enviroment_exception#.F0002.NNSY =
<cfqueryparam value="55" cfsqltype="CF_SQL_VARCHAR">
        </cfquery>
        
        <cftransaction action="COMMIT"/>
        

        <!--- Set number to have zeros in from which will be shortened
throughout application --->
        <cfset variables.TrimOrderNum = "0000000#GetNextNumber.Next#">

        <!--- Set new line number to be 1 up from old number --->
        <cfset variables.newlinenumber = GetNextNumber.Next + 1>
                
        <!--- Insert new line number --->
        <cfquery name="InsertNewLineNumber" datasource="#request.AS400dsn#"
dbtype="ODBC">
                update  #request.enviroment_exception#.F0002
                SET     NNN002 = <cfqueryparam
value="#variables.newlinenumber#" cfsqltype="CF_SQL_INTEGER">
                WHERE   #request.enviroment_exception#.F0002.NNSY =
<cfqueryparam value="55" cfsqltype="CF_SQL_VARCHAR">
        </cfquery>
        
        <cftransaction action = "rollback"/>
                
                
</cftransaction>

Robert Everland III
Dixon Ticonderoga
Web Developer Extraordinaire
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to