HELP ME PLEASE?!?!

HELP ME PLEASE?!?!

Post by Dale Mille » Sun, 05 Nov 2000 12:46:48



Can someone please help me with foreign keys? My problem is this. I have

a table TICKET, which I want to join with 4 other tables CUSTOMER,
STAFF, FLIGHT and CLASS. When I try to declare more than 2 foreign keys
in SQL*Plus I get an error. It works fine for 1 or 2 but how do I
declair 4 attributes as foreign. All of my data matches up with each
other with my primary keys all matching my foregin keys but im still
getting an error. Bellow is an example of what I need to do:

CREATE TABLE Ticket
        (Tic_Num        INTEGER         NOT NULL,
         Sea_Loc        SMALLINT        NOT NULL,
         Pay_Rec        CHAR(3)                 ,
         Hol_Day_Num    SMALLINT                ,
         Tic_Spe        Char(40)                ,
         Fli_Num        SMALLINT        NOT NULL,
         Cla_Num        SMALLINT        NOT NULL,
         Sta_Num        SMALLINT                ,
         Cus_Num        SMALLINT                ,
         Sal_Dat        DATE                    ,
         PRIMARY KEY (Tic_Num),
         FOREIGN KEY (Fli_Num)
                REFERENCES Flight,
        FOREIGN KEY (Cla_Num)
                REFERENCES Class,
        FOREIGN KEY (Sta_Num)
                REFERENCE Staff,
        FOREIGN KEY (Cus_Num)
                REFERENCE Customer
         );

I get an error saying "missing parenthesis" whe im sure I have it right?

I have tried all different combinations but I cant get it right. Anyones

help would be greately appriciated as I have to hand in a assignment in
less that a week.

Dale Miller

 
 
 

HELP ME PLEASE?!?!

Post by Noel » Tue, 07 Nov 2000 15:49:23



> Can someone please help me with foreign keys? My problem is this. I have

> a table TICKET, which I want to join with 4 other tables CUSTOMER,
> STAFF, FLIGHT and CLASS. When I try to declare more than 2 foreign keys
> in SQL*Plus I get an error. It works fine for 1 or 2 but how do I
> declair 4 attributes as foreign. All of my data matches up with each
> other with my primary keys all matching my foregin keys but im still
> getting an error. Bellow is an example of what I need to do:

> CREATE TABLE Ticket
>         (Tic_Num        INTEGER         NOT NULL,
>          Sea_Loc        SMALLINT        NOT NULL,
>          Pay_Rec        CHAR(3)                 ,
>          Hol_Day_Num    SMALLINT                ,
>          Tic_Spe        Char(40)                ,
>          Fli_Num        SMALLINT        NOT NULL,
>          Cla_Num        SMALLINT        NOT NULL,
>          Sta_Num        SMALLINT                ,
>          Cus_Num        SMALLINT                ,
>          Sal_Dat        DATE                    ,
>          PRIMARY KEY (Tic_Num),
>          FOREIGN KEY (Fli_Num)
>                 REFERENCES Flight,
>         FOREIGN KEY (Cla_Num)
>                 REFERENCES Class,
>         FOREIGN KEY (Sta_Num)
>                 REFERENCE Staff,
>         FOREIGN KEY (Cus_Num)
>                 REFERENCE Customer
>          );

> I get an error saying "missing parenthesis" whe im sure I have it right?

> I have tried all different combinations but I cant get it right. Anyones

> help would be greately appriciated as I have to hand in a assignment in
> less that a week.

> Dale Miller


Problem is typo - missing "s" on last two occurences of REFERENCES keyword.

Noel

 
 
 

1. emergency please help me please please please

we are unable to access all the functions of SQL Enterprise Manger
Also when trying to get into SQL Secuity Manager we get this message:

You must use the System Administrator's (sa) when using SQL Security Manager

    any response will be appreciated

2. how to use a MS SQL 7.0 Server with Borland cpp builder 3?

3. immdiate help now please please please

4. Years comparison-Help

5. Please Help me, Please Help me

6. DAO350.DLL Registration problem with VB5.0

7. Help,, Help SQL7 PLease oh Please

8. i can't install DBD::Sybase 0.21, core error, who can help me?

9. Help me please please help !!!!!

10. Please Help Me Please !!!!!

11. please help me please

12. Please Help Me Please!