Home » Developer & Programmer » Forms » master detail problem
master detail problem [message #682560] Wed, 28 October 2020 17:12 Go to next message
compuscience
Messages: 85
Registered: September 2012
Member
i create master table emp(emp_number,emp_name,id,salary)
with detail 1 dept(dept_name,emp_number,id)
with detail 2 job(job_name,emp_number,id)

i didn't make primay key and forign key i make relation between them with emp_number,id


the only problem when i make update in master block not affect in detail 1 and detail 2 block



what can i do???
Re: master detail problem [message #682568 is a reply to message #682560] Thu, 29 October 2020 04:17 Go to previous messageGo to next message
compuscience
Messages: 85
Registered: September 2012
Member
any idea please
Re: master detail problem [message #682571 is a reply to message #682568] Thu, 29 October 2020 08:44 Go to previous messageGo to next message
Littlefoot
Messages: 21623
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What did you update in master, and what did you expect to see in details?

If you updated EMP_NUMBER, that's most probably a bad idea. It acts as if it was a primary key, and you really, really rarely update primary keys.

Other columns are EMP_NAME, ID (what ID?) and SALARY which don't even exist in detail blocks, so ... I'm afraid I don't quite understand the question. Could you explain it? Post a form screenshot, maybe it'll make things move obvious.
Re: master detail problem [message #682574 is a reply to message #682571] Thu, 29 October 2020 10:23 Go to previous messageGo to next message
compuscience
Messages: 85
Registered: September 2012
Member
That what i was talk about
  • Attachment: 111.png
    (Size: 35.39KB, Downloaded 55 times)
Re: master detail problem [message #682580 is a reply to message #682574] Thu, 29 October 2020 12:52 Go to previous messageGo to next message
Littlefoot
Messages: 21623
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That's what I was saying. Don't modify keys used to create relationship. Think of it as if it was a social security number; you get it once, and keep till the end of your life. You don't change it, ever.
Re: master detail problem [message #682582 is a reply to message #682560] Thu, 29 October 2020 14:19 Go to previous messageGo to next message
compuscience
Messages: 85
Registered: September 2012
Member
i need to modify it when we write id or emp_number wrong
this may be happen


then what can i do to update detail with the new value
Re: master detail problem [message #682583 is a reply to message #682582] Thu, 29 October 2020 16:48 Go to previous messageGo to next message
compuscience
Messages: 85
Registered: September 2012
Member
Understand me
Re: master detail problem [message #682584 is a reply to message #682583] Thu, 29 October 2020 17:41 Go to previous messageGo to next message
Amine
Messages: 320
Registered: March 2010
Senior Member

You need this : update cascade.

https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:31812348052

Follow the comments at the end.
Re: master detail problem [message #682585 is a reply to message #682584] Thu, 29 October 2020 18:16 Go to previous messageGo to next message
compuscience
Messages: 85
Registered: September 2012
Member
Amine wrote on Fri, 30 October 2020 00:41
You need this : update cascade.

https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:31812348052

Follow the comments at the end.
Link in this topic is invalid
Re: master detail problem [message #682586 is a reply to message #682582] Fri, 30 October 2020 04:00 Go to previous messageGo to next message
John Watson
Messages: 8427
Registered: January 2010
Location: Global Village
Senior Member
You have been caught out by the problem of using a natural key as a primary key. Bad move! Your primary/foreign key relationships need to be based on surrogate keys, not natural keys. You should have studied the use of surrogate keys and natural keys in college (it is a standard topic that all data science courses should cover) but if not better start now. This article is fair start,
https://en.wikipedia.org/wiki/Surrogate_key
and the papers published by Ralph Kimball take the topic further. Look up Slowly Changing Dimensions, too: They are a problem caused by use of natural keys that has made many multi-terabyte multi-million dollar databases worthless.
Re: master detail problem [message #682587 is a reply to message #682585] Fri, 30 October 2020 06:29 Go to previous message
Amine
Messages: 320
Registered: March 2010
Senior Member

I said follow the comments at the end...

"Search for 'update' in the Presentation Downloads under Resources."
Previous Topic: how to skip insertion in oracle forms after 2 records
Next Topic: web.show_document problem during mailing a report from a Form
Goto Forum:
  


Current Time: Sun Nov 29 20:05:53 CST 2020