December 1st, 2003, 06:55 AM
-
Creating a Composite Key.....
CREATE TABLE addresses OF address
(
houseNum PRIMARY KEY
);
This is how I create a primary key when creating a table.
Does anyone know how I would create a primary key using both the house number and say the telephone number (ie. telNo), which in effect would be a composite key????
December 1st, 2003, 08:16 AM
-
create table addresses (
houseNum NUMBER,
telNo NUMBER,
constraint pk_address primary key (houseNum,telNo)
)
Regards,
Dan
December 1st, 2003, 09:30 AM
-
That gives me this error:-
SP2-0734: unknown command beginning "constraint..." - rest of line ignored.
SP2-0042: unknown command ")" - rest of line ignored.
Its like as if it doesnt recogise the word "constraint" ???????
December 1st, 2003, 09:49 AM
-
Its okay, I got it!
Thanks, you were right, with a little adjustment of the syntax.