Re: how records can be validated for uniqueness before commit [message #79932] |
Fri, 26 July 2002 06:14 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Ranjit Bisoyi
Messages: 18 Registered: November 2001
|
Junior Member |
|
|
Hi,
Pls see , if this works for you.
Go_Block('Block');
First_Record;
While :Block.Field Is Not Null Loop
Curr_Rec := System.Cursor_Record;
Curr_Fld := :System.Cursor_Field;
If Curr_Fld = :System.Cursor_Field and :System.Cursor_Record <> Curr_Rec Then
Message('Duplicate Found');pause;
Raise Form_Trigger_Failure;
Next_Record;
End Loop;
---It works like this. Take the record number and the field value for which you want to check uniqueness. Navigate from top to button and check the field against all the records except the original one.
--
H
Regds
Ranjit Bisoyi
|
|
|
Re: how records can be validated for uniqueness before commit [message #87643 is a reply to message #79932] |
Wed, 26 January 2005 01:50 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Amarsey
Messages: 17 Registered: March 2002
|
Junior Member |
|
|
I have tried the code but it did not work.
I have a detail block and want to check the uniqueness of the records b4 saving but as i press the button it brings the message that Duplicate Records is found and if i correct the record it continues to show up the same message. this your code i modified:
declare
Curr_Rec varchar2(200);
Curr_Fld varchar2(200);
begin
Go_Block('Control_blk');
First_Record;
While :Control_blk.amount Is Not Null Loop
Curr_Rec := :System.Cursor_Record;
Curr_Fld := :System.Cursor_Field;
If Curr_Fld = Curr_Rec Then
--:System.Cursor_Field and :System.Cursor_Record=Curr_Rec Then
Message('Duplicate Found');
Message('Duplicate Found');
pause;
Raise Form_Trigger_Failure;
Next_Record;
end if;
End Loop;
end;
|
|
|