Home » Developer & Programmer » Designer » Question on Oracle Database Design
Question on Oracle Database Design [message #206352] Wed, 29 November 2006 13:22 Go to next message
suranjita_hajra_7
Messages: 20
Registered: November 2006
Location: Pittsburgh, USA
Junior Member

Hello,

I have a question on Oracle Database Design.
I have a parent table with "Sales_Order_Head" column and this column is a PRIMARY KEY in this parent table. I also have a child table with "Sales_Order_Line" column and this column is a Foreign Key to the primary key column in the parent table.
Now my requirement is that when I insert a record in the primary key column - "Sales_Order_Head" of the parent table, I want that simultaneously a record should get inserted in "Sales_Order_Line" column of the child table. I know that this can be implemented programmatically but I have to implement this at design level.
How can I do this, please suggest me.

Thanks a lot in advance.

Regards,
Suranjita
Re: Question on Oracle Database Design [message #206353 is a reply to message #206352] Wed, 29 November 2006 13:26 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Why did you post this in the PL/SQL-experts forum if you're not interested in a programming-solution?

I don't get it when you say "I know that this can be implemented programmatically but I have to implement this at design level."
Could you please explain?
Re: Question on Oracle Database Design [message #206357 is a reply to message #206353] Wed, 29 November 2006 13:34 Go to previous messageGo to next message
suranjita_hajra_7
Messages: 20
Registered: November 2006
Location: Pittsburgh, USA
Junior Member

I have to imeplement this fact while creating the parent and child tables - that when a record is inserted in the "Sales_Order_Head" column of the Parent Table, simultaneously a record gets inserted in the "Sales_Order_Line" column of the Child Table.
I am aware that this can be implemented afterwards programmatically, however the requirement is that I have to implement this above fact while creation of parent and child tables.
Please suggest me how to do this.
Thanks a lot in advance.

Regards,
Suranjita.
Re: Question on Oracle Database Design [message #206379 is a reply to message #206357] Wed, 29 November 2006 18:05 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I believe that you may have misinterpreted the requirements that have been given to you. Please post the text from which you are working so that we can better answer your request.

David
Re: Question on Oracle Database Design [message #206544 is a reply to message #206352] Thu, 30 November 2006 08:34 Go to previous messageGo to next message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
You mean he can't use the cascade insert clause ? Laughing
Re: Question on Oracle Database Design [message #207992 is a reply to message #206544] Thu, 07 December 2006 13:23 Go to previous messageGo to next message
ab_trivedi
Messages: 460
Registered: August 2006
Location: Pune, India
Senior Member
hi suranjita,

so what is the status of your problem . do you use the cascade insert for child table .

Bye
Ashu
Re: Question on Oracle Database Design [message #218033 is a reply to message #206352] Tue, 06 February 2007 08:27 Go to previous messageGo to next message
ora_balan
Messages: 21
Registered: January 2007
Location: Mumbai, India
Junior Member
One way out is to indicate the mandatory child record requirement in your ER Diagram design and leave it later for the programmer to do the actual coding.

In the ER Diagrammer, create 2 entities, 1 for the master and 1 for the child. When you create a relation between the two, use the M:1 (mandatory to mandatory) Relationship. This would be a an icon that you'll see attached to this reply.

As a system analyst, I use that to indicate at least 1 child record to be mandatorily created whenever a Parent record comes into existence.

Of course, you'll need to back this up by a subsequent code which reflects such a design.

Hope this helps.
Re: Question on Oracle Database Design [message #227590 is a reply to message #206357] Wed, 28 March 2007 13:49 Go to previous message
pravin3032
Messages: 51
Registered: November 2006
Location: eARTH
Member
hi

as much i inderstood you can define trigger on Sales_Order_Head Table on insert which which will also insert record in
child table.

Previous Topic: One to One relationship and table design
Next Topic: ERWIN tool
Goto Forum:
  


Current Time: Thu Mar 28 13:11:56 CDT 2024