During the normal use of the application, some indexes are removed.
1-What can cause the indexes delete?
2-Is there a procedure to work with indexes?
3-Also some indexes are automatic renamed, and that cause an error when the index is called by the name.
Is there a way to solve the rename problem?
4- To try to deal with the delete and rename problem, I created a script to check indexes and create again if it is needed.
This script is called in autoexec, but we have problems to run this script in the shadow.
This is a high level function using indexes, first I tried a low level procedure using tbl.index_tag_add.
Anyone use a similar approach for this kind of problems?
1-What can cause the indexes delete?
2-Is there a procedure to work with indexes?
3-Also some indexes are automatic renamed, and that cause an error when the index is called by the name.
Is there a way to solve the rename problem?
4- To try to deal with the delete and rename problem, I created a script to check indexes and create again if it is needed.
This script is called in autoexec, but we have problems to run this script in the shadow.
This is a high level function using indexes, first I tried a low level procedure using tbl.index_tag_add.
Anyone use a similar approach for this kind of problems?
Code:
' Reference: http://wiki.alphasoftware.com/~alphafiv/INDEXES_MATCH_DEFSTRING+Function dim indexDef as C dim matchIndex as P ' 1- Check indexes in subsc_charged_items table 'indexDef = get_index_definitions("subsc_charged_items") indexDef = <<%txt% AUTO_NO|AUTO_NO|| AUTO_NO1|AUTO_NO||U INV_REC|INV_REC+CHARGE_TYPE|| SUB_AUTO_N|SUB_AUTO_NO+CHARGE_TYPE+THIS_CHAR|| SUB_REF|SUB_REF|ISBLANK("INV_REC")| SUB_REF1|SUB_REF+THIS_CHAR+CHARGE_TYPE|| SUB_REF2|SUB_REF||D SUB_REF3|SUB_REF|| SUB_REF4|SUB_REF+CHARGE_TYPE+THIS_CHAR|| THIS_CHAR|SUB_REF+CHARGE_TYPE+THIS_CHAR+SERV_TYPE||D __A5_RECORD__|RECNO()|| %txt% matchIndex=indexes_match_defstring("subsc_charged_items", indexDef) if matchIndex.Error=.F. .or. matchIndex.AdditionalIndexTags<>"" .or. matchIndex.MissingIndexTags<>"" Create_Indexes("subsc_charged_items", indexDef) end if
Comment