Subject | Re: [firebird-support] Re: List of table constraints |
---|---|
Author | Mark Rotteveel |
Post date | 2009-07-16T19:16:55Z |
eddressel wrote:
available in Firebird 1.5
(LANGREF.pdf; of Interbase 6).
won't be sure which UNIQUE index is the primary key, and a UNIQUE index
does not necessarily have a UNIQUE constraint.
--
Mark Rotteveel
> Thank you for your response.RDB$RELATION_CONSTRAINTS already existed in Interbase 6, it is also
>
>> From RDB$RELATION_CONSTRAINTS, naturally.
>
> Don't know if it makes a difference, I am using FB 1.5, and I could not find that.
available in Firebird 1.5
>> Have you ever read Language Reference?..The table is described on page 263 of the Language Reference
>
> yes, searched the PDF for 'constraint' and that was no help.
(LANGREF.pdf; of Interbase 6).
> I found the following SQL provides the information I need:This won't give all contraints. Only UNIQUE and FOREIGN KEY and you
>
> SELECT RDB$INDEX_NAME
> FROM RDB$INDICES
> WHERE RDB$RELATION_NAME='TABLENAME'
> AND (RDB$UNIQUE_FLAG IS NOT NULL OR RDB$FOREIGN_KEY IS NOT NULL);
won't be sure which UNIQUE index is the primary key, and a UNIQUE index
does not necessarily have a UNIQUE constraint.
--
Mark Rotteveel