Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Table Relationship
A copy of this was sent to violin.hsiao_at_mail.pouchen.com.tw (Violin)
(if that email address didn't require changing)
On Fri, 31 Jul 1998 04:21:57 GMT, you wrote:
>Hello,
>How can I solve the problem???
>
>I have 2 tables,TABLE1 and TABLE2
>
>TABLE1 TABLE2
>---------------------------------- ------------------------
>ORD_NO CHAR(12) ORD_NO CHAR(12)
>GROUP_A CHAR(2) ORD_NAM CHAR(20)
>GROUP_B CHAR(2) ACCT_NO CHAR(8)
>GROUP_C CHAR(2) QTY NUMBER(11,4)
>COLOR CHAR(3) :::::::::
>PK:ORD_NO PK:ORD_NO
>
>TABLE1 is master,and TABLE2 is detail of TABLE1,
>so the ORD_NO must exist in TABLE1 & TABLE2
>But when I add a foreign key ORD_NO reference TABLE1 (ORD_NO),
>it always failure.
>How could I create the relationship between TABLE1 & TABLE2?
>Please Cc to: violin.hsiao_at_mail.pouchen.com.tw,Thank you so much :)
SQL> create table table1
2 ( ord_no char(12) primary key, 3 group_a char(2)
Table created.
SQL>
SQL> create table table2
2 ( ord_no char(12) references table1(ord_no),
3 ord_name char(20)
4 )
5 /
Table created.
What error are you getting? How about capturing the table creates and their error messages -- that'll help us answer your question.
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Sat Aug 01 1998 - 09:28:00 CDT
![]() |
![]() |