Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Index
Message
From
18/10/2002 12:15:29
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Problem with Index
Miscellaneous
Thread ID:
00712933
Message ID:
00712933
Views:
58
I have a problem with an index that got out of wack. I have two tables, invoice header and invoice items. The total on the invoice header is supposed to be equal to the total on the items. In the case of the wacked out index this isnt true, but because the index is picking up the wrong information, it thinks its true. I have a routine in my posting run that checks the totals and stops posting, but if the index is out of wack it doesnt catch it. I need it to. In my posting run I call a method that contains:

METHOD artotalchk
*****************
LOCAL arsum, llOK
SELECT ariitems
SEEK STR(arinvoic.REFNO,6)
SUM ROUND(qty*amount,2) TO arsum FOR refno = arinvoic.REFNO
SELECT arinvoic
IF arsum <> arinvoic.AMOUNT - arinvoic.gstamt - arinvoic.pstamt
DO printerr WITH "Invoice reference "+alltrim(str(arinvoic.REFNO))+" header/item mismatch"
m.llOK = .F.
ELSE
m.llOK = .T.
ENDIF


I am wondering if there is another way that would avoid the index that could be corrupted. I think the index corruption is happening somewhere else and the customer isnt aware of it, so they dont reindex and data is being stored erronenously.

TIA,
Sandi
Next
Reply
Map
View

Click here to load this message in the networking platform