Home » Developer & Programmer » Forms » Master / Detail Forms Issue (Oracle Forms 6i)
Master / Detail Forms Issue [message #544431] Tue, 21 February 2012 11:45 Go to next message
ericr
Messages: 22
Registered: January 2006
Junior Member
I have a form that contains a tab canvas. On the second canvas page I have two data blocks with a master detail relationship.

The first block (master) is driven by a table (table_one) with the following fields:

sf_id (PK)
sf_code - VARCHAR2(40)
sf_desc - VARCHAR2(250)

The second block (detail) is a repeating block driven by a table (table_two) with the following fields:

error_code - VARCHAR2(40
error_code_desc - VARCHAR2(250)
is_major_error - VARCHAR2(1)
error_type - VARCHAR2(1)
error_is_active - VARCHAR2(1)
update_date - DATE
sf_id (FK - table_one.sf_id)

The second block only shows error_code and error_code_desc. The point of this canvas page is to add/remove master records and associate detail records with a master. I never want to actually insert or remove records from table two; merely updating the sf_id column in table two.

What I am trying to achieve is the following:
1. Create a master record with detail records at the same time.
2. Delete a master record
3. Add and remove detail records

An insert into the detail block is nothing more than associating a master record with a detail record by updating the sf_id column in table two. A delete from the detail block is nothing more than setting the sf_id column to null in table two. I am not actually adding or removing records in table_two. Does this make sense?

I have tried overriding the commit on the second block to perform updates instead of Oracle actually trying to insert NEW records into table_two.



Re: Master / Detail Forms Issue [message #544441 is a reply to message #544431] Tue, 21 February 2012 14:28 Go to previous messageGo to next message
ericr
Messages: 22
Registered: January 2006
Junior Member
I think I found my solution... on-insert and on-update triggers.

Thanks...
Re: Master / Detail Forms Issue [message #544507 is a reply to message #544441] Wed, 22 February 2012 02:39 Go to previous message
cookiemonster
Messages: 10846
Registered: September 2008
Location: Rainy Manchester
Senior Member
The other approach would be to base the detail block on a DB procedure, that should give you complete control.
Previous Topic: Unable to open form which is created in anthor PC
Next Topic: validate-from-list propery
Goto Forum:
  


Current Time: Sat Jul 26 10:41:07 CDT 2014

Total time taken to generate the page: 0.10018 seconds