December 1st, 2003, 07: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, 09:16 AM
create table addresses (
constraint pk_address primary key (houseNum,telNo)
December 1st, 2003, 10: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, 10:49 AM
Its okay, I got it!
Thanks, you were right, with a little adjustment of the syntax.