Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is this a bug in 9i ( FK question )
"Rob Williamson" <robw_at_physics.umd.edu> wrote in message
news:437A560D.FEB9356_at_physics.umd.edu...
>I am running 9i with a slightly outdated patch level.
> I have two tables Inventory and Shopping_Cart
> The Inventory has a primary key ( item_number ) smallint not null
> The Shopping_cart table has a composite pk key
> acct varchar(10) not null
> fname varchar(64) not null
> lname varchar(64) not null
> item smallint not null
>
>
> I tried to use the code:
> ALTER TABLE shopping_cart
> add constraint shopping_cart_fk_inventory
> foreign key (item)
> references (inventory.item_number);
>
> This failed
>
> I could only get the FK to work if I put it in the CREATE table
> statement;
>
> Anyone seen this.
>
> I have used other Alter table add constraints in my code even
> referencing the same table inventory.item_number
> and they worked.
> The only difference seems to be that shopping_cart has a composite key.
>
what was the error message?
what was the syntax of the statements that worked?
++ mcs
> I am a little behind on my patches so I thought I would ask out here.
>
> Thanks
> Rob
>
Received on Tue Nov 15 2005 - 16:02:25 CST
![]() |
![]() |