Milan:
No problem. If the index has an entry in sysmaster:systabnames then it is detached. An attached index will be stored within the parent table's partition and not have an entry there. That's the easiest way. Example, the attached index on the systables table on tabid:
> select * from systabnames where dbsname='art' and tabname = 'tabid';
No rows found.
Versus a detached index:
> select * from systabnames where dbsname='sysmaster' and tabname = 'flags_text_ix1';
partnum 1049505
dbsname sysmaster
owner informix
tabname flags_text_ix1
collate en_US.819
dbsnum 1
1 row(s) retrieved.
Within the database's catalog you can figure this out as well. If you query sysfragments for the parent table's tabid and a fragtype = 'I' and indexname = 'name-of-the-index' there will be no rows for an attached index while a detached index will have at least one sysfragments entry. Example, the attached index on the systables table on tabid:
> select * from sysfragments where tabid = 1 and fragtype = 'I' and indexname = 'tabid';
No rows found.
Versus a detached index:
> select *
> from sysfragments
> where tabid = 245 and fragtype = 'I' and indexname = 'flags_text_ix1';
fragtype I
tabid 245
indexname flags_text_ix1
colno 0
partn 1049505
strategy I
location L
servername
evalpos 0
exprtext
exprbin <BYTE value>
exprarr <BYTE value>
flags 0
dbspace rootdbs
levels 3
npused 42.00000000000
nrows 17.00000000000
clust 27.00000000000
partition rootdbs
version 1
nupdates 0.00
ndeletes 0.00
ninserts 343.0000000000
1 row(s) retrieved.
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com------------------------------