|
|
|
Re: how to skip insertion in oracle forms after 2 records [message #682318 is a reply to message #682313] |
Thu, 15 October 2020 15:41 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21811 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
See if such a block-level WHEN-NEW-RECORD-INSTANCE trigger helps; basically, you'd check how many rows the block currently have. If it is the 3rd row created, it'll raise an error.
declare
l_number_of_rows number;
begin
last_record;
l_number_of_rows := to_number(:system.cursor_record);
if l_number_of_rows > 2 then
message('2 rows only, sorry');
raise_form_trigger_failure;
end if;
end;
[Updated on: Fri, 16 October 2020 01:49] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|