Re: Trying to Generate Dynamic Sequence IDs as Stored Function or Stored Procedure.

2011-01-05 Thread Shawn Green (MySQL)
On 1/5/2011 13:31, James Dekker wrote: 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

Re: Trying to Generate Dynamic Sequence IDs as Stored Function or Stored Procedure.

2011-01-05 Thread James Dekker
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, J

Re: Trying to Generate Dynamic Sequence IDs as Stored Function or Stored Procedure.

2011-01-05 Thread Shawn Green (MySQL)
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 I

Re: Trying to Generate Dynamic Sequence IDs as Stored Function or Stored Procedure.

2011-01-04 Thread James Dekker
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 incremen

Re: Trying to Generate Dynamic Sequence IDs as Stored Function or Stored Procedure.

2011-01-04 Thread Peter Brawley
generate_dynamic_id('my_sequence_id_s', 'my_table_t', 'table_id', @dynamicId); Should be: CALL generate_dynamic_id('my_sequence_id_s', 'my_table_t', 'table_id', @dynamicId); PB On 1/4/2011 9:28 PM, James Dekker wrote: Hello there, I am using MySQL 5 on OS X - Snow Leopard... Have w

Trying to Generate Dynamic Sequence IDs as Stored Function or Stored Procedure.

2011-01-04 Thread James Dekker
Hello there, I am using MySQL 5 on OS X - Snow Leopard... Have working code in place which obtains the highest sequence number ID from a sequence table and then increments and assigns it to its corresponding table: The original code's purpose is to dynamically increments a specific table's las