Generate Sequence Number Safely

  • Any process needing a unique number queries the LNU table to get the number and performs a delete statement. A Trigger on LNU for delete adds 1 to the LNU from deleted and places it in the LNU field. That's how it works and it handles lots of LNU's.

  • 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

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply