Subject Re: could not find UNIQUE INDEX with specified columns
Author troller507
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@...> wrote:
>
> 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
create
> it at the same time while creating "test".
>
>
> Martijn Tonies
> Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB,
Oracle &
> MS SQL Server
> Upscene Productions
> http://www.upscene.com
> My thoughts:
> http://blog.upscene.com/martijn/
> Database development questions? Check the forum!
> http://www.databasedevelopmentforum.com
>

Hi

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