Home » Developer & Programmer » Forms » Duplicate Check on Data Block (No Procedure)
Duplicate Check on Data Block (No Procedure) [message #439794] Tue, 19 January 2010 07:38 Go to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Dear Gurus,

How are you all.? I wonder if there is some tiny technique to trace a duplicity on a block label without committing the records ( Maybe on Validate or new record instance)
/forum/fa/7324/0/
I have one procedure to check duplicate but what I remember that there is something very smart provided from oracle to do that.. Please let me know.



Jak

Re: Duplicate Check on Data Block (No Procedure) [message #439796 is a reply to message #439794] Tue, 19 January 2010 07:52 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why not just post them? You can apply records to the database without commiting, and if the user decides not to save their changes they will be rolled back.
Then you can use all the standard methods to check for duplicates.
icon12.gif  Re: Duplicate Check on Data Block (No Procedure) [message #441167 is a reply to message #439796] Fri, 29 January 2010 03:04 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member


Hey Hi everybody

Thanks for the suggestions though i wrote many things for check and every another techniques working fine , but unfortunately my user don wanna be handcuffed so they decided to go on with multiple entries at once and what this form has to do is insert only once even user enters a million of times... Its a Bad Bad world isnt it everybody trying to make their life easier...anyway thanks for spending time on that Gurus.. I will be back soon Ba Bye...


Jak
Re: Duplicate Check on Data Block (No Procedure) [message #441176 is a reply to message #441167] Fri, 29 January 2010 03:55 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
javed.khan wrote on Fri, 29 January 2010 09:04

but unfortunately my user don wanna be handcuffed so they decided to go on with multiple entries at once and what this form has to do is insert only once even user enters a million of times.


Why? Why would the user care at what point the data is applied to the database? The only thing the user needs to care about is when the records are committed.
Re: Duplicate Check on Data Block (No Procedure) [message #441185 is a reply to message #441176] Fri, 29 January 2010 05:30 Go to previous messageGo to next message
Rolic
Messages: 22
Registered: January 2010
Location: Latvia
Junior Member
If duplicate records are restricted at all then use unique key at the table level. And you can always override the system's message with appropriate message if you know the constraints name. We do so here at my work.
Re: Duplicate Check on Data Block (No Procedure) [message #441188 is a reply to message #441185] Fri, 29 January 2010 05:47 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
Rolic wrote on Fri, 29 January 2010 11:30
If duplicate records are restricted at all then use unique key at the table level.

OP wanted to do the check before applying the records to the db, so a unique key isn't going to help (you should still have one obviously)
Rolic wrote on Fri, 29 January 2010 11:30

And you can always override the system's message with appropriate message if you know the constraints name.

For unique constraint violations the error number should usually be enough unless you've got a multi-block form and want to be really specific.
Re: Duplicate Check on Data Block (No Procedure) [message #441189 is a reply to message #441188] Fri, 29 January 2010 06:05 Go to previous messageGo to next message
Rolic
Messages: 22
Registered: January 2010
Location: Latvia
Junior Member
Just after posting previos commetn an idea came into my mind, but that is usefull if the table size isn't big. Or at least you can define some basic criterias for reducing the operating data.

The idea is... use pl/sql table with varchar2 index.

type pt_table is table of integer index by varchar2(100);
vt_table pt_table;


Before data manipulating collect all data in this pl/sql table (trigger 'key create record') and then after each phisycal insert in form (not in DB), add another record to pl/sql table. Use each record's structure as varchar2 index. Hence -> before adding new record to pl/sql table, you can chech with

if not vt_table.exists(v_rec) 
then 
    v_rec := <concatenate records structure>; 
    vt_table(v_rec) := 1; 
else 
   <prompt user> 
end if;


.. in WHEN VALIDATE RECORD trigger or something like that.

But again... it will work fast, if your table isn't too big or you can determine not too big amount of data collected into pl/sql table.




CM - Added code tags, please do so yourself next time, see the orafaq forum guide if you're not sure how.

[Updated on: Fri, 29 January 2010 06:11] by Moderator

Report message to a moderator

Re: Duplicate Check on Data Block (No Procedure) [message #445526 is a reply to message #439794] Tue, 02 March 2010 06:03 Go to previous message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Hmm ...Why i am replying back is i applied the last post suggestion and get appreciated...Thanks everyone
Previous Topic: Number Puzzle With DeveloperSuite
Next Topic: Issues during migration from forms 4.5 to 10g
Goto Forum:
  


Current Time: Thu Nov 07 17:17:22 CST 2024