Dave,
So I dont need the commit and rollback options? I can just use it like
this.. see below
Regards,
JB
<CFTRY>
<cftransaction>
<CFQUERY NAME="aRecord" DATASOURCE="xxx">
Select FirstName
FROM tApply
WHERE [identity] = 2
</CFQUERY>
<CFQUERY NAME="aRecord" DATASOURCE="xxx">
Select FirstName
FROM tApply
WHERE [identity] = 2
</CFQUERY>
</cftransaction>
<cfcatch type = "DATABASE">
<!--- Test S --->
<BODY TEXT="1c3b85">
<DIV ALIGN="Center">
<TABLE>
<TR>
<TD WIDTH="400">
<H2>A Database Error Has Occurred !</H2>
<CFOUTPUT> #CFCATCH.Message#
<P>The following exception has occurred, TYPE=
#CFCATCH.Type#
</CFOUTPUT>
</TD>
</TR>
</TABLE>
</DIV>
<!--- Test E --->
</cfcatch>
</CFTRY>
Dave Carabetta wrote:
>>I need some help. What I'm trying to do is setup a transaction that's
>>purpose is to move a record from table "A" to table "B" and if it is
>>successful delete it from "A." If anything fails roll back and output
>>the error. Can anyone please offer some insight to either using
>>different code or patching what I have below?
>>
>>I'm running CF5 Enterprise.
>>
>>
>
>Just wrap it all in a <cftransaction> and you'll be fine:
>
><cftransaction>
> <cfquery...>
> INSERT INTO table2 (
> columnName
> )
> SELECT columnName
> FROM table1
> </cfquery>
>
> <cfquery...>
> DELETE
> FROM table1
> WHERE id = #yourID#
> </cfquery>
></cftransaction>
>
>Regards,
>Dave.
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4