Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Auto Increment of ID based on some field value in table

VARSHA H RMar 24 2021

I am developing an application for Receipts (money received from clients) we collect money. Once a receipt is saved a Voucher Number gets generated and assigned to the saved Voucher.

Since I have multiple branch offices I want to generate numbering Branch wise since money is collected at different locations. I thought of 2 ways to get this done.

  1. Create Branch wise Receipt Forms with multiple tables and have Numbering sequence set. Challenge with this is that i will have to create a new form every time a new branch office is opened.

  2. Create a Single Receipt Form and auto generate Numbering sequence Branch wise.

Let's say I have 2 Locations ABC & XYZ which are 2 branch offices:

When the user from location ABC logs in and generates Receipts, Numbering to start from 1.

ABC-1, ABC-2, ABC-3 and it goes on.

Whereas when the user from Location XYZ logs in and generates Receipts, Numbering to start from 1.

XYZ1, XYZ2, XYZ3 and it goes on.

Comments
Post Details
Added on Mar 24 2021
8 comments
331 views