Home » Developer & Programmer » Forms » how to skip insertion in oracle forms after 2 records
how to skip insertion in oracle forms after 2 records [message #682306] Thu, 15 October 2020 10:34 Go to next message
compuscience
Messages: 97
Registered: September 2012
Member
how to skip insertion in oracle forms after 2 records

i.e (i create data block with max no. Of records are 2
But when trying to insert ,i can insert more than 2
rows)

What i need to make restriction to insert 2 rows only

[Updated on: Thu, 15 October 2020 10:36]

Report message to a moderator

Re: how to skip insertion in oracle forms after 2 records [message #682312 is a reply to message #682306] Thu, 15 October 2020 14:32 Go to previous messageGo to next message
compuscience
Messages: 97
Registered: September 2012
Member
Can anyone help me please
Re: how to skip insertion in oracle forms after 2 records [message #682313 is a reply to message #682312] Thu, 15 October 2020 14:45 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Wait a little bit, there are few people now knowing Forms here.

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 messageGo to next message
Littlefoot
Messages: 21806
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

Re: how to skip insertion in oracle forms after 2 records [message #682320 is a reply to message #682318] Thu, 15 October 2020 16:39 Go to previous messageGo to next message
compuscience
Messages: 97
Registered: September 2012
Member
I will try it
Thank you very much
Re: how to skip insertion in oracle forms after 2 records [message #682321 is a reply to message #682318] Thu, 15 October 2020 17:26 Go to previous messageGo to next message
compuscience
Messages: 97
Registered: September 2012
Member
:system.current_record give bad bind variable in oracle forms 6i
Re: how to skip insertion in oracle forms after 2 records [message #682325 is a reply to message #682321] Fri, 16 October 2020 01:49 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try :system.cursor_record, then. I made a mistake, there's no variable I initially suggested. Sorry.
Re: how to skip insertion in oracle forms after 2 records [message #682380 is a reply to message #682325] Wed, 21 October 2020 07:08 Go to previous messageGo to next message
compuscience
Messages: 97
Registered: September 2012
Member
nice


but there was piece of problem
when i need to update in this block it hang in last entered record and refuse to go to any row
Re: how to skip insertion in oracle forms after 2 records [message #682387 is a reply to message #682380] Wed, 21 October 2020 10:13 Go to previous messageGo to next message
compuscience
Messages: 97
Registered: September 2012
Member
Need help please
Re: how to skip insertion in oracle forms after 2 records [message #682390 is a reply to message #682387] Wed, 21 October 2020 11:01 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Michel Cadot wrote on Thu, 15 October 2020 21:45

Wait a little bit, there are few people now knowing Forms here.
Re: how to skip insertion in oracle forms after 2 records [message #682396 is a reply to message #682390] Wed, 21 October 2020 13:46 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Updates usually "hang" because someone else is holding that row, so your Forms application is waiting for it to be released.

Who is it? Maybe you, in your other Forms session, the one you terminated, or in SQL*Plus, or someone else updates the same row and didn't commit (nor rollback), ...

Or, maybe it is code you wrote - it doesn't actually "hang" but runs in an indefinite loop.
Re: how to skip insertion in oracle forms after 2 records [message #682406 is a reply to message #682396] Thu, 22 October 2020 07:49 Go to previous messageGo to next message
compuscience
Messages: 97
Registered: September 2012
Member
No there is no one except me connect


The hang in the block which i trigger ot with the code
Re: how to skip insertion in oracle forms after 2 records [message #682422 is a reply to message #682406] Thu, 22 October 2020 23:59 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As Forms 6i doesn't have debug option, put MESSAGE calls into your code in order to trace its execution.
Re: how to skip insertion in oracle forms after 2 records [message #682509 is a reply to message #682318] Tue, 27 October 2020 02:28 Go to previous messageGo to next message
compuscience
Messages: 97
Registered: September 2012
Member
the problem which i talk about before is in the code in update mode


then how can i stop this code while i update
Re: how to skip insertion in oracle forms after 2 records [message #682530 is a reply to message #682509] Tue, 27 October 2020 11:52 Go to previous messageGo to next message
compuscience
Messages: 97
Registered: September 2012
Member
compuscience wrote on Tue, 27 October 2020 09:28
the problem which i talk about before is in the code in update mode


then how can i stop this code while i update

need help please
Re: how to skip insertion in oracle forms after 2 records [message #682544 is a reply to message #682530] Wed, 28 October 2020 03:46 Go to previous message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't understand what it means. Could you explain it?
Previous Topic: KEY-ENTER function
Next Topic: master detail problem
Goto Forum:
  


Current Time: Thu Mar 28 18:41:46 CDT 2024