Board index » delphi » referencing RDB$RELATIONS(RDB$RELATION_NAME)

referencing RDB$RELATIONS(RDB$RELATION_NAME)

Hi
I've tried to build foreign key constraint that references system table.
---------------
CREATE TABLE QA_HISTORY (
    QAH_ID INTEGER NOT NULL,
    QAH_TABLE_NAME VARCHAR(50) NOT NULL,
    CONSTRAINT FK_QAH_TABLE_NAME FOREIGN KEY (QAH_TABLE_NAME) REFERENCES
RDB$RELATIONS(RDB$RELATION_NAME));
----------
The error I get is:
unsuccessful metadata update. store rdb$relation_constraints failed.
attempt to store duplicate value in unique index rdb$index_12

Do I do something wrong or it's impossible to reference system tables?

Thanks
Igor

 

Re:referencing RDB$RELATIONS(RDB$RELATION_NAME)


Quote
Igor wrote:

> The error I get is:
> unsuccessful metadata update. store rdb$relation_constraints failed.
> attempt to store duplicate value in unique index rdb$index_12

> Do I do something wrong or it's impossible to reference system tables?

        I've never tried it, but I don't *think* that's what's causing your
error.  Are you certain the index name you've picked is unique?

        -Craig

--
Craig Stuntz (TeamB)       Senior Developer, Vertex Systems Corp.
Delphi/InterBase weblog:   http://delphi.weblogs.com
Use Borland servers; posts via others are not seen by TeamB.
For more info, see http://www.borland.com/newsgroups/genl_faqs.html

Other Threads