>
> Is there a good way to solve this issue?
>
> Thanks a lot
>
Yes, multiple actually.
.......
one db centric solution is to create a sequence for each customer id and then nextval that specific sequence when you need a new id.
Would need to know more about the number of customers and how often you expect to assign new IDs - to each - to recommend other possibilities.
David J.