Skip to Main Content

APEX

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!

APEX Interactive Grid - How to ensure no Duplicate records get inserted in DB column (without unique

Amit_ApexJul 23 2019 — edited Jul 25 2019

Hi All,

APEX version 5.1

I want to enable a validation during RUN Time to ensure that do not allow data insertion by throwing error message when use will put the same value for one interactive Grid Column which is not enabled with unique constraints.

For Example:

I have Existing Product TableĀ  Where I do not have any Primary & unique key constraints . It holds many records including duplicates at present. and hence can not enable constraints now.

No I am building a UI on top of this table to allow new record insertions using Interactive Grid. Here I want to make sure No duplicate data should be inserted going forward. I already enabled a Validation that if Any Product Name , Exists in DB then throw an error if user tries to insert Record with Existing Product Name( by checking Existing DB values and comparing it with Item values in session).

However this validation is not working when user adds two or more new records with same Product Names and data is getting inserted in DB.

I want to make sure that if user is using same Product Names more than once for new records entry, thenĀ  Error Message should appear.

Example: If User is Inserting "Apple" & "Apple" (When Apple Product is not existing in DB) in two rows of Interactive Group then I should get some error like "Duplicate records insertion not allowed"

Please advise how to enable it.

Comments
Post Details
Added on Jul 23 2019
7 comments
5,471 views