Duplicate Check on Data Block (No Procedure) [message #439794] |
Tue, 19 January 2010 07:38 |
|
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)
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 #441167 is a reply to message #439796] |
Fri, 29 January 2010 03:04 |
|
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 |
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 #441188 is a reply to message #441185] |
Fri, 29 January 2010 05:47 |
cookiemonster
Messages: 13952 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Rolic wrote on Fri, 29 January 2010 11:30If 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 |
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
|
|
|
|