lake wrote:As you might know, not everything developers implement is bug free, especially when it comes to the developers who implemented jive as it seems ;)
It's weird that the forum software posts things another 2 times when someone posts something when the software is in its
very slow for some reason state.
I forgot about that.
Form program unit: function COMPARISON (in1 number, in2 number) is if in1 = in2 then return(1); else return(0); end if; end; 3 new hidden fields: CONTROL.PK_COPY DATABLOCK.MATCH_FOUND calculation mode: formula formula: COMPARISON(:control.PK_COPY, :datablock.PK) CONTROL.NUMBER_OF_MATCHES calculation_mode: summary summary_function: Sum summarised_block: DATABLOCK summarised_item: MATCH_FOUND WHEN_VALIDATE_ITEM on DATABLOCK.PK :control.pk_copy := :datablock.pk; if :control.number_of_matches > 1 then message('matching key found'); end if; (DATABLOCK must have query_all_records = TRUE)
lake wrote:Moderator Action:
It's weird that the forum software posts things another 2 times when someone posts something when the software is in its very slow for some reason state. So then there needs to be a remove all but one of them function in there. Have I missed it? Very ironic considering the discussion was how to detect and stop duplicate records.
so what is the best solution?I can't answer that - it depends on your situation! I personally prefer a Record Group solution (see: Duplicate Record Checking), but there is a little more code involved. There is also a similar method listed on Francois Degrelle's site (Avoid duplicated records in the same block). Which method is the best is up to you!
The best solution is to add constraints to your table to enforce the uniqueness of your columns on the lowest level.I agree and disagree with this statement. A database constraint is definately needed, however, in a web deployed form I don't want the network trip to the database to check for uniqueness. Since Forms went to the web, it is better to perform as much checking as it possible in the Form (Client) to reduce network traffic to the database! One of the primary causes of poor performance in a web deployed form is excessive network traffic! See Forms Tuning Techniques - Users will sing yoru praise and Oracle FOrms 10g Tuning Tips for more information! :)