search the archives, this has been discussed several times here. In short, do two queries. query 1, get the next val in your sequence. now you have your id in hand. query 2, do your insert using the id. do whatever you want with the id.
DK On 7/11/05, Daniel Kessler <[EMAIL PROTECTED]> wrote: > > I create a new game and insert it into my Oracle database. From > there I want to have the game ID and put it into a cookie. I've used > NEXTVAL AND CURVAL for inserting the value into the db, but not for > any external use, like my insert into a cookie. I guess I can do a > CFLock and then do a query after the insert for the last inserted > item, but is that the best way? > > Here's the insert: > > <CFQUERY NAME="add_item" DATASOURCE="esmart"> > INSERT INTO fsnep_food_store_game_info > ( > gi_id,login_id, > date_added,date_modified, > grocery_list,budget, > month,num_people, > num_weeks > ) > VALUES > ( > unique_food_store_game_info_s.NEXTVAL,#cookie.fsnep_login#, > SYSDATE,SYSDATE, > <cfqueryparam value="#form.g_list#" > cfsqltype="cf_sql_varchar">,<cfqueryparam value="#form.budget#" > cfsqltype="cf_sql_varchar">, > <cfqueryparam value="#form.the_month#" > cfsqltype="cf_sql_varchar">,<cfqueryparam > value="#form.the_num_people#" cfsqltype="cf_sql_varchar">, > <cfqueryparam value="#form.the_weeks#" cfsqltype="cf_sql_varchar"> > <!--- <cfcookie name="fsnep_bargain_hunt_gi_id" > value="#unique_food_store_game_info_s.CURVAL#"> ---> > ) > > </CFQUERY> > > > thanks for any help. > > -- > Daniel Kessler > > Department of Public and Community Health > University of Maryland > Suite 2387 Valley Drive > College Park, MD 20742-2611 > 301-405-2545 Phone > www.phi.umd.edu <http://www.phi.umd.edu> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211530 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

