Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Master-Detail-Detail Relation

Status
Not open for further replies.

NITIN27

Programmer
Dec 11, 2003
24
IN
Hi,

I have Three tables

1)
create table emp(
emp_id varchar2(6) constraint pk_emp_id primary key,
emp_name varchar2(40));

2)
create table dept_mst(
emp_id varchar2(6),
dept_code varchar2(40) constraint pk_dept_code primary key,
constraint fk_dept_mst_Emp foreign key(emp_id)
references emp(emp_id));

3)
create table dept_det(
dept_code varchar2(6),
dept_name varchar2(40),
dept_mgr varchar2(40),
constraint fk_dept_det foreign key(dept_code)
references dept_mst(dept_code));


Now i want to make a form in which all these above tables will come now relation is like this

"emp is a master table of dept_mst"
"dept_mst is a master table of dept_Det"

I have created a form and started making entry

I ENTERED EMP_ID,EMP_NAME IN EMP TABLE IN FORM THEN IN THE DEPT_MST TABLE I HAVE ENTERED DEPT_CODE BUT AS SOON AS I TRY TO MAKE ENTRY IN DEPT_DET IT SHOWS A MESSAGE

"DO YOU WANT TO SAVE RECORDS"

CAN I AVOID THIS MESSAGE AND CAN I MAKE A FULL ENTRY IN FORM AT SAME TIME

Thanks in advance
 
Nitin,

Without dealing with your Forms issues for a moment, from strictly a relational-database-design perspective, your dept_det and dept_mst tables seem to have a 1-to-1 relationship. I cannot see any reason not to consolidate them into one table. Doing this should then solve your problem with "DO YOU WANT TO SAVE...".

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 06:58 (01Jan04) GMT, 23:58 (31Dec03) Mountain Time)
 
SantaMufasa,

This was just an example But Pls tell me how to do it in a single form with 3 tables

Thanks
 
It sounds as thought you have a trigger firing (perhaps trying to clear a block?) when you attempt to make your DEPT_DET block. I would try running the form in debug to see what triggers are firing.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
BJCooperIT,

There are no triggers at Block-Level When i navigates out of dept_mas(table) block and comes to dept det block at runtime. It flashes the message "Do You want to save records"

If u are not able to understand that what i am saying then in a form which has some records then View the records and change any record and without saving go to next record then same message will get displayed
"Do You want to save records"

 
If you are navigating to a different master record (which causes the detail block to be queried automatically), you will encounter this message if forms detects that the detail block has pending changes. It is a result of the default trigger firing.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
Can you try to create the same form from scratch and use only Forms wizards? I'm about to be sure that this is a side effect of your manual interference. In most cases such errors are made by not quite experienced Forms developers who are not aware of Forms default behaviour and who try to code master-detail coordination manually.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top