Forms: How to Check for Duplicates using a Record Group

, , 1 comment
Collected from the link : https://sites.google.com/site/craigsoraclestuff/oracle-forms---how-to-s/oracle-forms

Almost everyone who works with Oracle Forms knows what a Record Group (RG) is and how to use them to supply the data set to a Forms List Of Values (LOV) or Poplist/TList objects.  What many people don't know is that there are a set of Forms Built-Ins for dynamically creating a Record Group in memory which gives you the ability to perform Array type processing using native Forms funcationality versus using a PL/SQL Collection, VArray, etc.  I have used RGs to keep track of rows selected in a multi-record block, perform duplicate checking, as well as many other tasks. 
 
In this demo, I give an example of how to perform Duplicate value checks and search a multi-record block for a specific value.  Typically, the search for a value in a multi-record block is done by navigating to the target block and the first record of the block and then looping through each row of the block until the specified value is found.  Depending on the number of records in the source table, this search method could be fairly quick or painfully slow.  Using RGs, rather than checking each row in the block one by one, you simply check the RG if the value is present in the RG.  If it is found, the Record_Number is returned.  Then you navigate to the found record using the Go_Record() built-in. 
 
This sample form was developed using Oracle Developer Suite 10g R2 (Patchset 3).  I am in the process of creating a Forms 6i and Forms 10g R1 version and will have these posted shortly.
 

1 comment: