Subject Re: [firebird-support] concurrent inserts issue
Author Helen Borrie
At 12:51 PM 11/07/2012, firebirdsql wrote:
>When I run the below query as a stored procedure asynchronously 1000 times, it results in duplicate numbers:
>select count(id) from test_table into :number;
>insert into test_table(number) VALUES(:number+1);
>How do I solve this? I tried the WITH LOCK option but it doesn't work inside a stored procedure.

You solve it by not doing it. Use a generator to set this value.