>>>I need to know what the record number of a query > >I suppose you mean what is the last id set to an automatic counter >field, since physical record numbers are not accessible in SQL. > >Use a query to get the maximum value of your id field, and don't forget >to lock the area which contains the insert query, ie: > ><CFLOCK... ><CFQUERY... > INSERT ... ></CFQUERY> ><CFQUERY NAME="getMax"... > SELECT max (idCounter) AS id > FROM ... ></CFQUERY> ><CFSET lastId = getMax.id> ></CFLOCK> > >where "idCounter" is the name of your counter column. >
Thanks Claude! I've never used <CFLOCK> before, what will happen if someone else is adding info to the DB at the same time? Will it give them an error message or will the site just wait for the DB to be unlocked? Riv ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade & see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283652 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

