Subject | RE: [firebird-support] Error while trying to add a primary key |
---|---|
Author | Larry Johnson |
Post date | 2008-11-02T16:43:03Z |
A query on RDB$INDICES returns this information about my table:
"PK_MEDIATYPE ", "MEDIATYPE ", 1, 1,
<Null>, 1, <Null>, <Null>, <Null>, 0, <Null>, <Null>, 0
Given the index name, I assume there already is a Primary Key (PK) on this
column, which is what I want. However, a call to SQLPrimaryKeys(), returns
zero rows.
Thus, I'm going to have to report this as a bug. My program needs to know
what the primary key field is, and that is the purpose of calling
SQLPrimaryKeys().
From: Larry Johnson [mailto:larry@...]
Sent: Saturday, November 01, 2008 10:27 AM
To: 'firebird-support@yahoogroups.com'
Subject: RE: [firebird-support] Error while trying to add a primary key
There is already an index on that column, true, but it isn't declared as a
primary key, as far as I can tell. I'll check into this more, though. One
question: Is RDB$INDEX_5 then the name of the index in question? Note that
the ALTER statement doesn't name an index, only a column to name as a key,
so the name is generated for me.
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Vlad Khorsun
Sent: Saturday, November 01, 2008 9:55 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Error while trying to add a primary key
Regards,
Vlad
[Non-text portions of this message have been removed]
"PK_MEDIATYPE ", "MEDIATYPE ", 1, 1,
<Null>, 1, <Null>, <Null>, <Null>, 0, <Null>, <Null>, 0
Given the index name, I assume there already is a Primary Key (PK) on this
column, which is what I want. However, a call to SQLPrimaryKeys(), returns
zero rows.
Thus, I'm going to have to report this as a bug. My program needs to know
what the primary key field is, and that is the purpose of calling
SQLPrimaryKeys().
From: Larry Johnson [mailto:larry@...]
Sent: Saturday, November 01, 2008 10:27 AM
To: 'firebird-support@yahoogroups.com'
Subject: RE: [firebird-support] Error while trying to add a primary key
There is already an index on that column, true, but it isn't declared as a
primary key, as far as I can tell. I'll check into this more, though. One
question: Is RDB$INDEX_5 then the name of the index in question? Note that
the ALTER statement doesn't name an index, only a column to name as a key,
so the name is generated for me.
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Vlad Khorsun
Sent: Saturday, November 01, 2008 9:55 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Error while trying to add a primary key
> But back to my real problem. Taking your advice, I copied firebird.msgs tounique
> my executable's directory, and now the error reads:
>
>
>
> DIAG [HY000] [ODBC Firebird Driver][Firebird]unsuccessful metadata update
>
> STORE RDB$INDICES failed
>
> attempt to store duplicate value (visible to active transactions) in
> index "RDB$INDEX_5" (-607)You already have index named as one you want to create.
Regards,
Vlad
[Non-text portions of this message have been removed]