Subject Re: [ib-support] conversion error from string
Author Svein Erling Tysvær
Hi Carsten!

>I have an after insert trigger like this:
>BEGIN
>update t_rechnung set id_rechnung = (select max(id_rechnung) + 1 FROM
>t_rechnung) where
>NEW.id_rechnung = id_rechnung;
>END

I know nothing about your error message, but using this kind of code for
creating a primary key or any unique value in a multiuser environment is
asking for trouble! My guess is that the error occurs when two users
"simultaneously" (one transaction starts before the other is committed) is
trying to update the table. The reason you haven't seen it for other tables
is probably because these tables are less frequently added to. Change to
using before insert triggers which set id_rechnung to
GEN_ID(<your_generator_name>, 1) if no value for id_rechnung is set
explicitly.

Set