Hello everyone.
I could use some thoughts on the following problem I am having. I have a query that
deletes all records in a table with a certain value in the ID field. I then turn
around and insert records back into the same table (some of which might be the same as
I just deleted). What I think is happening is that the delete is not being committed
to the DB before I do the insert. Unfortunately I am on CF 4.01, which does not make
life any easier. Any insight would be greatly appreciated. My code thus far is below.
<cftransaction>
<cfquery datasource="#request.Datasource#">
DELETE
FROM HazMMSLink
WHERE
Haz_ID = #attributes.HazardID#
</cfquery>
<cftransaction action="COMMIT" />
</cftransaction>
<cfif attributes.SelectedMakeModelSeries NEQ 0>
<cfloop index="i" list="#attributes.SelectedMakeModelSeries#" delimiters=",">
<cfquery datasource="#request.Datasource#">
INSERT INTO HazMMSLink
(
Haz_ID,
MMS_ID,
Record_Change_User_ID
)
VALUES (
#attributes.HazardID#,
#i#,
#request.UserInfo.UserID#
)
</cfquery>
</cfloop>
</cfif>
Thanks,
Michael T. Tangorre
----------------------------------------
MillenniuM Information Systems
1101 Wilson Blvd. Suite 1200
Arlington, Virginia 22209
O: 703-341-1438
C: 607-426-9277
----------------------------------------
Golden Rule:
"He who has the gold, makes the rules!"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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