Because some sequence tables contain one to many cardinality and MySQL tables can only have one auto_increment column...
Is there a way to do what I am trying to do (obtain max sequence id, set it to its corresponding table, and then increment by one) in a stored function? Happy programming, James On Jan 5, 2011, at 10:01 AM, Shawn Green (MySQL) wrote: > On 1/4/2011 23:23, James Dekker wrote: >> Peter, >> >> Thanks for the response! >> >> Unfortunately, that worked but a new error arose: >> >> check the manual that corresponds to your MySQL server version for the right >> syntax to use near 'ID = (select max(CONVERT(id_field, signed)) from >> my_table_t)' at line 1 >> >> Is there a better way to generate incremented sequence IDs? >> >> Can this be done in a stored function? >> > > Is there a particular reason why you cannot use an auto_increment column to > atomically create your sequence number? > > -- > Shawn Green > MySQL Principal Technical Support Engineer > Oracle USA, Inc. > Office: Blountville, TN -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org