Home » Developer & Programmer » Forms » Duplicate Record (10g,Forms 6i)
Duplicate Record [message #626057] Mon, 20 October 2014 04:24 Go to next message
glmjoy
Messages: 187
Registered: September 2011
Location: KR
Senior Member
Create Table ABC(B_No Char(10);

Insert into ABC('AAAAAAAAAAA');
Insert into ABC('BBBBBBBBBBB');
Insert into ABC('CCCCCCCCCCC');

On form level I want to stop Duplicate Value and will give message of Duplicate Record
if some one insert again the above record it will give message.

AAAAAAAAAAA
AAAAAAAAAAA
BBBBBBBBBBB
CCCCCCCCCCC


On Validate Item I have made trigger but its not working.

declare
cBL_Number char(30);
begin
select count(*)
into cBl_Number
from Igm_Header;
--where Bl_Number= cBl_Number ;
if cBl_Number>1 then
message('Duplicate ');
message('Duplicate ');
end if;
end;

I dont know where i am mistaking.

Thanks in Advance

[Updated on: Mon, 20 October 2014 04:36]

Report message to a moderator

Re: Duplicate Record [message #626060 is a reply to message #626057] Mon, 20 October 2014 04:37 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
1) Please read and follow How to use [code] tags and make your code easier to read? - I'm sure you've been asked before.
2) If you're going to change object names before posting, do it consistently or don't bother. The names in your code aren't same as the names in the create table statement.
3) The where clause you've commented out is obviously wrong - you need to restrict the query with the form item you're checking, not a local variable with no value.
4) Message will not prevent the user from saving the duplicate record - you need to use raise form_trigger_failure.
5) For this approach to work you must ensure each new record is added to the DB before another is entered - using either post or commit.
Re: Duplicate Record [message #626096 is a reply to message #626060] Mon, 20 October 2014 12:37 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
This is a common question. A simply Google search on "Oracle Forms Duplicate Record Check" will given you numerous examples of how to perform this check.

Craig...
Re: Duplicate Record [message #626151 is a reply to message #626096] Tue, 21 October 2014 10:23 Go to previous messageGo to next message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
have you solved your problem @Craig is right this is very comman question anywayz i have had already provided solution on this forum regarding related to your question if you need i can upload .FMB file.

Regard
Mughal

[Updated on: Tue, 21 October 2014 10:25]

Report message to a moderator

Re: Duplicate Record [message #626227 is a reply to message #626151] Thu, 23 October 2014 01:02 Go to previous message
glmjoy
Messages: 187
Registered: September 2011
Location: KR
Senior Member
Thanks to All I have solved it
Previous Topic: user define message should populate
Next Topic: Form Navigate Abnormally
Goto Forum:
  


Current Time: Tue Apr 23 22:19:06 CDT 2024