Hi all
I was rebuilding some indexes, and some of them got stuck (later found out to be due to wobbly network). I found that if I removed the index and then added it again, this usually got around some of the rebuild type problems. This worked really well for Btree, but for relational indexes, having removed the index, or even before removing the index I had trouble figuring out what the relationship was so I could restore it.
Is there some form that I missed that shows you the relationship parameters? I couldn't retrieve an existing relationship in the index using the add relational index form. What table and fields would I need to list to get back the information I need to feed to the add relational index form to restore the index?
Thanks
Scott
Scott,
At least you can use System Editor and look at the fields' dictionary rows.
According to SYSPROCS*DICT_EQUATES fields 23-25 of a data field's dictionary row tells us if that field is involved in relational indexing. Dict field 23 is non-null if the data field is source. The content says which data field is destination. And vice versa with dict field 24.
But you probably know all this.
- Oystein -
Maybe what he is saying, - wouldnt it be nice if I could print out a simple report which documents the index relationships.
Try this. I confess it's a bit crude. The listing is not sorted, and all relations are listed twice.
- Oystein -
function List_Rel_Ix( Dummy ) $insert Logical $insert Dict_Equates equate CrLf to char(13) : char(10) equate Tab to char(9) Result=" TableNames=@Tables NumTables=count(TableNames, @FM) + (TableNames '') for T=1 to NumTables if (TableNames1, 5 EQ 'DICT.') and (TableNames1, 8 NE 'DICT.SYS') then FieldNames=Xlate( TableNames, "%FIELDS%", FIELDS_NAME$, "X" ) convert @VM to @FM in FieldNames NumFieldNames=count(FieldNames, @FM) + (FieldNames '') for F=1 to NumFieldNames Rel_Ix_Relational=Xlate( TableNames, FieldNames, DICT_RELATIONAL$, "X" ) Rel_Ix_Related =Xlate( TableNames, FieldNames, DICT_RELATED$, "X" ) if Rel_Ix_Relational then Result := TableNames6,999 : "*" : FieldNames : " is source for " : Rel_Ix_Relational : CrLf end if Rel_Ix_Related then Result := TableNames6,999 : "*" : FieldNames : " is destination for " : Rel_Ix_Related : CrLf end next F end next T return Result
Oystein,
Thanks for the piece of code. I know that it will come in handy sometime .
Ray
rayc@symmetryinfo.com onmouseover=window.status=imagine … ;return(true)"
Ray Chan ~ Symmetry Info