Subject | Re: could not find UNIQUE INDEX with specified columns |
---|---|
Author | troller507 |
Post date | 2008-10-16T09:20:53Z |
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@...> wrote:
CREATE TABLE test (field1 integer, field2 char(1024), field3 integer,
PRIMARY KEY (field1))
After:
ALTER TABLE test ADD FOREIGN KEY (field3) REFERENCES test(field1)
Throws: could not find UNIQUE INDEX with specified columns
Regards
Joe
<m.tonies@...> wrote:
>create
> Hello Joe,
>
> > I can't understand the error message which occures when I try to
> > create the following table:
> >
> > CREATE TABLE test (field1 integer, field2 char(1024), field3 integer,
> > PRIMARY KEY (field1), FOREIGN KEY (field3) REFERENCES test(field1))
> >
> > What do I miss?
>
> A primary key or unique constraint on TEST.Field1.
>
> Create the FK afterwards by using ALTER TABLE instead of trying to
> it at the same time while creating "test".Oracle &
>
>
> Martijn Tonies
> Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB,
> MS SQL ServerHi
> Upscene Productions
> http://www.upscene.com
> My thoughts:
> http://blog.upscene.com/martijn/
> Database development questions? Check the forum!
> http://www.databasedevelopmentforum.com
>
CREATE TABLE test (field1 integer, field2 char(1024), field3 integer,
PRIMARY KEY (field1))
After:
ALTER TABLE test ADD FOREIGN KEY (field3) REFERENCES test(field1)
Throws: could not find UNIQUE INDEX with specified columns
Regards
Joe