Avatar of mjfigur
mjfigur
 asked on

Trigger insert sequence from defined set of values

I am not quite sure how to describe it but I have an application where end users submit accounts to be worked and they all go in a table. I am in need of assigning these accounts to a group of ten other users for example. These ten users have their own personal user id's.

Thus when the account is inserted into the table a trigger needs to insert a specific user id in the "Assigned" column and do so in a sequence to ensure an equal number of accounts per person. Just not sure how to design this.

Thanks in advance.
Oracle Database

Avatar of undefined
Last Comment
mjfigur

8/22/2022 - Mon
slightwv (䄆 Netminder)

Round robin? So every 10th record is assigned to the same person?

Try the MOD operator against the sequence.

Not 100% accurate since sequences are not gapless but something like setting assigned to: Mod(sequence.nextval,10)
ASKER CERTIFIED SOLUTION
Franck Pachot

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
mjfigur

ASKER
Thank you that is such a great idea. Will have it pull dynamically assigning them when they are requested will allow for my fluidity especially when one of the users may be out of the office on a given day or week.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy