Home » SQL & PL/SQL » SQL & PL/SQL » DDL for a Table (Oracle,10g,MS Win)
DDL for a Table [message #430504] Tue, 10 November 2009 14:03 Go to next message
y2raza
Messages: 34
Registered: March 2008
Member
guys this is little urgent, i apologize if i am posting in the wrong forum, i have a business rule which i can not seem to figure how to implement, goes as follows:

Each Product is supplied by a supplier to only one Depot and then moved on into stock at the other depots.

how to enforce this in a table ? so that one Product goes to one Depot?

thank you
Re: DDL for a Table [message #430511 is a reply to message #430504] Tue, 10 November 2009 15:21 Go to previous messageGo to next message
BlackSwan
Messages: 24903
Registered: January 2009
Senior Member
Do I correctly understand this situation?

You are asking for our assistance to provide a CONSTRAINT between tables
for which we don't know the table names or columns within them.

solve with FOREIGN KEY


You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Go to the URL above click the link "Posting Guidelines"
Go to the section labeled "Practice" & do as directed.

[Updated on: Tue, 10 November 2009 15:39]

Report message to a moderator

Re: DDL for a Table [message #430518 is a reply to message #430511] Tue, 10 November 2009 16:15 Go to previous messageGo to next message
y2raza
Messages: 34
Registered: March 2008
Member
the tables are products and depots M:M relationship a reference table, unique constraint only looks for duplicate value, i am thinking of creating a trigger!

Re: DDL for a Table [message #430522 is a reply to message #430518] Tue, 10 November 2009 17:30 Go to previous message
BlackSwan
Messages: 24903
Registered: January 2009
Senior Member
>i am thinking of creating a trigger!
IMO, a Foreign Key is a simpler solution.
Previous Topic: Performance of MERGE statement
Next Topic: Col size
Goto Forum:
  


Current Time: Sat Sep 24 23:09:11 CDT 2016

Total time taken to generate the page: 0.05702 seconds