Home » Developer & Programmer » Forms » Insert and update (Oracle forms 10g,Oracle 11g database, Win 7 )
Insert and update [message #650698] Fri, 29 April 2016 14:51 Go to next message
shumail
Messages: 149
Registered: September 2012
Location: Canada
Senior Member
Hi All

I have a master details form and I would like to use this form for inserting and updating , I try to cover my scenario by using scot and tiger schema.

Suppose in Master block , I have deptno text item and 1 push button that is called get_data .

When I click push button (get_data) in master block then system will post some data in details block like empno, job and comm+sal (non database item) and when I commit it then it save record.

Now What I want is that if user enter value in master block , item name =deptno=10 then system first check this value already exist in Master table dept and if exist then query that specific deptno and populate master and details blocks and in case if value not exist then allow for insertion otherwise updation. Thanks

Re: Insert and update [message #650709 is a reply to message #650698] Sat, 30 April 2016 15:11 Go to previous messageGo to next message
bluetooth420
Messages: 146
Registered: November 2011
Senior Member
Steps are like these.

AT master level when dept no is entered. then validate it if the entered dept id is ok or not

Next if the entered no is valid then goto detail block
use loop
and insert records into detail block one by one.

Thats it
Re: Insert and update [message #650713 is a reply to message #650709] Sun, 01 May 2016 09:47 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
In my opinion, you are trying to reinvent the wheel.

Forms does all of that by default, you don't have to write a single line of code. All you have to do is to educate yourself/your users how to properly use the tool (i.e. Forms).

While in query mode, you check whether certain master block record already exists. If so, querying mechanism will display both master AND detail records (if such a relationship is properly defined; it is, if you used Data Block Wizard). Otherwise, you'll get the message that it does not exist so you'll exit query mode and - in insert mode - insert new master and detail records.

As simple as that. As I said: not a single line of code to be written.
Re: Insert and update [message #651260 is a reply to message #650713] Fri, 13 May 2016 11:51 Go to previous message
shumail
Messages: 149
Registered: September 2012
Location: Canada
Senior Member
Thanks for you replies guys, I use the default functionality as littlefoot suggested. Thanks
Previous Topic: Need to perform multiple insertion
Next Topic: FRM- 41213: Unable to connect to the report server-Weblogic12c
Goto Forum:
  


Current Time: Thu Mar 28 07:47:26 CDT 2024