dbaccess question
Posted in 1999
Topics: Server Administration
Does anyone know the query language statement to create a
primary key constraint in dbaccess?
In article <36906A83.C60AB0FA@pobox.com>,
Tim Leahy <timleahy@pobox.com> wrote:
> Does anyone know the query language statement to create a
> primary key constraint in dbaccess?
>
Tim the statement that would be in your SQL is as follows:
CREATE TABLE mytable (
column1 char,
column2 char,
PRIMARY KEY (column1) CONSTRAINT pk_mytable
);If you already have the table then you would use the alter table...:
ALTER TABLE mytable ADD CONSTRAINT PRIMARY KEY (column1) CONTRAINT pk_column1;
Where there are primary keys there are foreign keys:
ALTER TABLE yourtable ADD CONSTRAINT FOREIGN KEY (column1) REFERENCES mytableCONSTRAINT fk_column1;
Does this answer your question?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own