On Wed, 6 Aug 2003 11:47:35 +0200, "hobbes" <pasdespam@yahoo.fr>
wrote:
>Hi !
>
>since my last post was answered successfully , i try antoher one 
>
>I want to know Index(es) and primary keys on specific tables.
>
>
>So i make a query between systables and sysindices.
This will give you the index name. Remember that if the unique index
doesn't exist when you generate the primary key constraint, Informix
will create one for you, as a combination of tabid and constrid. When
Informix does this for you, the first character if idxname will be
blank.
>
>But as i want to know if it is a primary key => I check the value of
>sysconstraints.constrtype.
Constrtype should be 'P'.
>When i try to make the link between => sysconstrints and sysindexes on
>idxname it does not work.
>
>The explanation:
>=============
>in fact idxname in sysconstraints is not always filled with the index name.
>sometimes it is fill with a value and sometimes not.(just blank)
>
On my version, when idxname isn't set, it is because constrtype is
'N', a not null constraint on a column. What is your Informix
version?
>for example with 2 tables:
>customer
>dealer
>
>they each have 1 PK and 1 IDX.
>
>The informations in sysconstraints are here , but
>=> for the table customer => i 've got the idxname filled. (so i can make
>difference between the idx and the PK)
>=> for the table customer => idxname not filled.....
>
>the tables have been created at the same time in the same script (with 250
>other tables which some have the sysconstraint.idxname information and other
>not)
>so, my question is ... why ? 
>
>In fact is there a way to regenerate the idxname or am i doing somethig
>wrong ?
dbschema should allow you to see the index name, unless it is a
system-generated index name.
>
>Thank you by advance for any answers !
>
>Arnaud
>