Happy Holidays,
Thanks all for your suggestions.
I find that using a global table to store sequences and using SP to get the NextKey from that table is the affordable solution to my problem. Thanks jxflagg.
Anyway, I got interested with alzdba's way to generate an invoice number. Yup, my invoice number has a predefined prefix followed by monthyear and a sequence like the following: Inv0312xxxx (InvYYMM xxxx=sequence)
Thanks
Hendry