Be careful if you do this, oracle and some others reuse deleted IDs if you don't use sequences. Using cftransaction and querying for the data you just input would be my suggestion. Actually, if you can using a sequence would probably be best if you have access to them. ------Original Message------ From: Brian McCairn To: ColdFusion Mailing List ReplyTo: ColdFusion Mailing List Subject: Re: Getting last inserted record from database Sent: Oct 26, 2009 3:09 PM
select the max id straight after the insert and wrap it all in cftransaction tags ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327701 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4