In that Blog entry, he's using last_insert_id(), which is a mysql
function, so no CF can't do it on it's own.  I still say the way that
Oracle and Postgres does this is the best.  Before you do an insert, you
can select the next available ID, and this ID can NEVER be used by
anybody else (selecting it basically generates it for use).  Then use
that ID in your insert.  Takes care of the problem of needing the last
inserted ID, because you have the ID before you do the insert, and then
you can use it after as well. 

> -----Original Message-----
> From: Per Djurner [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 04, 2006 2:14 PM
> To: CF-Talk
> Subject: Safely selecting last inserted ID
> 
> I'm trying to find a good solution that works for me when it 
> comes to the
> classic problem of selecting the last inserted ID in a 
> database table and
> making sure it's thread safe.
> I came across this article that basically says that CF can 
> handle this all
> on it's own (no need for cftransaction or using @@identity etc).
> 
> Does anyone know if there is any truth to this:
> http://weblogs.macromedia.com/cantrell/archives/2004/11/safely
> _selectin_1.cfm

------------------------------------------------------------------------------
This transmission may contain information that is privileged, confidential 
and/or exempt from disclosure under applicable law. If you are not the intended 
recipient, you are hereby notified that any disclosure, copying, distribution, 
or use of the information contained herein (including any reliance thereon) is 
STRICTLY PROHIBITED. If you received this transmission in error, please 
immediately contact the sender and destroy the material in its entirety, 
whether in electronic or hard copy format. Thank you. 

==============================================================================
"EMF <idahopower.com>" made the previous annotations.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262803
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to