Re: SP to output Updated value with a multithreaded java client
Posted by: Todd Farmer
Date: August 14, 2013 08:46AM

Hi Saravanan,

It's hard to say without looking at your stored procedure code, but it sounds like there's a bug there. The most reliable way to use incrementing values in MySQL is to create a table with an auto-incrementing primary key. This can be a dummy table referenced by the stored procedure, which would do an INSERT and then retrieve LAST_INSERT_ID():

http://dev.mysql.com/doc/refman/5.6/en/information-functions.html#function_last-insert-id

Here's a good example of a stored function using this technique:

http://www.mysqlperformanceblog.com/2008/04/02/stored-function-to-generate-sequences/

Hope that helps!

--
Todd Farmer
MySQL @ Oracle
http://www.oracle.com/mysql/

Options: ReplyQuote


Subject
Written By
Posted
Re: SP to output Updated value with a multithreaded java client
August 14, 2013 08:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.