View Single Post

   
  #3 (permalink)  
Old 04-19-2008, 07:21 PM
John Carlson
 
Posts: n/a
Default Re: Index and Pk not referenced into syscontraints !

On Wed, 6 Aug 2003 16:54:00 +0200, "hobbes" <pasdespam@yahoo.fr>
wrote:

>> 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.

>
>Yes that what i'm trying to get ...
>in fact i want to obtain 3 things :
>1)the index name,
>2)the uniquess of the index
>3)if the index is a primary key or not



OK, I see now . . .

Join between sysindexes and sysconstraints would be tabid and idxname.
You could add constrtype = 'P' also

>
>> >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?

>
>I use IDS 9.3 (i wait for the 9.4 ..... IBM seems on hollyday ...)
>Something frightened me in your answer => 99% of our database is made with
>not null constraint on columns.......
>(i gonna try to find information about that)
>


Sounds like Lawson . . . . 8-)

You could isolate constraint type by using "constrtype = 'P'" as part
of your join. Shouldn't make any difference, since null constraints
do not have an associated index.
>
>Ok, thk you for the answer....
>
>=======
>=======
>
>AND FINALLY .....
>after checking my database creation script ....
>i noticed one big (big, really ..... i can say huge) BUG.
>My script is auto-generated from an Oracle database .....
>and the generation of the primary key script is done randomly due to a
>"poor" parameter...
>


Thus, the PKs were never created? That might cause a problem on the
Informix side if you're looking for primary keys that don't exist.
Informix is good, but not that good . . . .8-)

>
>so this time too , it's my fault.
>I'm sorry....
>thk you for the answer, it put me on the right way to find the issue.
>
>
>Bye
>Arnaud
>
>Hope that the not null constraints isn't a limitation !
>


Reply With Quote