UPDATE menu_sequence SET id=LAST_INSERT_ID(id+1);
 
 
I am writing some code that I need to actually get the menu_sequence from 
above, store it in a  variable and then do a increment. I do not know why I am 
having trouble with this, but it looks like I would have to
String seq = "select id from menu_sequence"
use seq,
then
String update = "update menu_sequence set id=last_insert_id(id+1)
 
The reason is, I need to use the "seq" variable to create a true ID using some 
other algorithms. Anyway is there a better or simpler way to do this? I hate to 
do two queries and then I have to worry about synchronization.
 
thanks,
Scott
 

Scott K Purcell | Developer | VERTIS | 
555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 
314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com 
<http://www.vertisinc.com/>  

Vertis is the premier provider of targeted advertising, media, and 
marketing services that drive consumers to marketers more effectively. 
                                                 

 

Reply via email to