Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Missing right parenthesis
On 10 Jul 2003 11:36:14 -0700, jhoug2_at_hotmail.com (Jon) wrote:
>Specifically, the problem is in the "ALTER TABLE meta_packet ADD"
>portion of this statement. When I execute the ALTER TABLE portion of
>the above statement from the SQL> prompt as follows, I am getting this
>error:
>
>SQL> ALTER TABLE meta_packet ADD
> 2 (
> 3 CONSTRAINT meta_packet_pk PRIMARY KEY (id),
> 4 CONSTRAINT mac_pair_fk FOREIGN KEY (mac_pair_id)
> 5 REFERENCES mac_addr_pair (id),
> 6 CONSTRAINT payload_fk FOREIGN KEY (payload_id)
> 7 REFERENCES payload (id)
> 8 USING INDEX TABLESPACE indx);
Foreign key constraints don't cause an index to be created, therefore a USING INDEX TABLESPACE clause is invalid.
Only specify it for PRIMARY KEY and UNIQUE constraints.
ALTER TABLE meta_packet ADD
(
CONSTRAINT meta_packet_pk PRIMARY KEY (id)
USING INDEX TABLESPACE indx,
CONSTRAINT mac_pair_fk FOREIGN KEY (mac_pair_id)
REFERENCES mac_addr_pair (id),
CONSTRAINT payload_fk FOREIGN KEY (payload_id)
REFERENCES payload (id)
);
>USING INDEX TABLESPACE indx)
>*
>ERROR at line 8:
>ORA-00907: missing right parenthesis
>
>Is there a syntax problem, are there too many CONSTRAINT/REFERENCES
>statements or are the CONSTRAINT/REFERENCES statements in the wrong
>order? I am at a loss to understand the problem. Any ideas?
-- Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk) Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)Received on Thu Jul 10 2003 - 15:59:32 CDT
![]() |
![]() |