[Q] FOREIGN AND PRIMARY KEY SYNTAX PROBLEMS
Posted in 1994
I am having problems creating tables with FOREIGN KEYS
I may be too close to the problem so can't see something really simple but
If you know what is wrong with a 4.01 i-sql, 5.01 online on SCO UNIX 3.2 and this syntax
please let know:
CREATE TABLE test
(test_cd char(3) NOT NULL,
test_ds char(30) NOT NULL
, PRIMARY KEY (test_cd));
CREATE TABLE testpl
(test_cd char(3) NOT NULL,
testpl_nr char(10) NOT NULL,
testpl_typ_cd char(5) NOT NULL,
testpl_cls_cd char(2) NOT NULL,
testpl_ds char(30),
testpl_note_tx varchar(10000)
, PRIMARY KEY (test_cd,
testpl_nr,
testpl_typ_cd)
, FOREIGN KEY fk_test (test_cd
) REFERENCES test
);