Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> SQL relating to foreign key table

SQL relating to foreign key table

From: John <jriker1_at_yahoo.com>
Date: 5 Apr 2003 19:07:14 -0800
Message-ID: <e6bb5a8d.0304051907.7f0aec0c@posting.google.com>


I need to write a small block of SQL code and was looking for some advice on the "correct" way to do this. Let's say I have three tables, one is a list of products, which is already populated with product info. The third table has a list of ways a product can be packaged. Of course all products are not packaged in all ways. The second table is where I will store the list of each product and have it is packaged. So I have a foreign relation from the product table to the way packaged table. And a foreign relation from the way packaged table to the list of packaging type. Ok, so I am importing a list of product codes and the way it's packaged, one line for each package method. I want to do an insert into the second table with the product number and the reference to the third table that matches the package method in each line. Can someone show me a sample of how to formulate a SQL code to say I have this Package method, what is the unique identifier in the third table that goes with this so I can put that value in the second table? Thanks.

JR Received on Sat Apr 05 2003 - 21:07:14 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US