Home » Developer & Programmer » Forms » How Can We Stop to insert Data (forms 6i)
How Can We Stop to insert Data [message #443831] Wed, 17 February 2010 08:35 Go to next message
qanita786
Messages: 229
Registered: May 2007
Location: PAKISTAN
Senior Member
Dear How Can We Stop to insert Data if Master Block have the record and detail block have no record but commit command applied i want that commit command can not be work if detail block have no record

kind regards
Re: How Can We Stop to insert Data [message #443863 is a reply to message #443831] Wed, 17 February 2010 12:52 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Maybe you can try adding a pre-insert trigger on your master block to check if data exist in the detail block.
Re: How Can We Stop to insert Data [message #443970 is a reply to message #443863] Thu, 18 February 2010 03:11 Go to previous messageGo to next message
tamzidulamin
Messages: 132
Registered: October 2009
Location: Dhaka
Senior Member
dear,

In Pre-Insert-Trigger Check DetailBlock have any reocrds or not if not then RAISE FORM_TRIGGER_FAILURE.


Regards,

Tamzidul Amin
Re: How Can We Stop to insert Data [message #444478 is a reply to message #443970] Mon, 22 February 2010 03:40 Go to previous messageGo to next message
qanita786
Messages: 229
Registered: May 2007
Location: PAKISTAN
Senior Member
How can we check number of records

regards
Re: How Can We Stop to insert Data [message #444480 is a reply to message #444478] Mon, 22 February 2010 03:47 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
A simple way of doing that is to check whether a required item in the detail block has a value.

Something like
if :detail_block.id is not null then
   -- everything is OK, there is at least one record in the detail block
   null;
else
   message('No records in detail block');
   raise form_application_error;
end if;


Otherwise, you'd need to scroll through the whole detail block and count records (not necessarily one by one - LAST_RECORD would do the job).
Re: How Can We Stop to insert Data [message #444488 is a reply to message #444480] Mon, 22 February 2010 04:19 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Littlefoot wrote on Mon, 22 February 2010 09:47

Otherwise, you'd need to scroll through the whole detail block and count records (not necessarily one by one - LAST_RECORD would do the job).


Except you can't do that from pre-insert.
Re: How Can We Stop to insert Data [message #444491 is a reply to message #444488] Mon, 22 February 2010 04:23 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Perhaps I should read the whole thread /forum/fa/1606/0/
Re: How Can We Stop to insert Data [message #447100 is a reply to message #444478] Thu, 11 March 2010 22:17 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Sorry that I have been so long in replying. Have you solved your problem?

David
Previous Topic: FRM-40734 : INTERNAL ERROR : PL/SQL ERROR OCCURRED
Next Topic: ODBC drivers support
Goto Forum:
  


Current Time: Fri Sep 20 10:48:36 CDT 2024