Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Inconsistency Error' VFP6

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,334
FR
I have a newly created table which I am processing to populate with records, I get to about 2500 and the system throws the error above.

If I add a blank record before I start, the process completes properly?

The structure looks like this:
Code:
CREATE TABLE 'POPAROLE.DBF' NAME 'POPAROLE' (JOBNO C(10) NOT NULL, ;
ENQNO C(10) NOT NULL, ;
COMPANY C(8) NOT NULL, ;
ROLE C(8) NOT NULL, ;
FLAG L NOT NULL)

There are six indexes:
Code:
INDEX ON JOBNO+ENQNO+ROLE+COMPANY TAG POPAR1
INDEX ON ENQNO+JOBNO+ROLE+COMPANY TAG POPAR2
INDEX ON COMPANY+JOBNO+ENQNO+ROLE TAG POPAR3
INDEX ON COMPANY+ENQNO+JOBNO+ROLE TAG POPAR4
INDEX ON ROLE+ENQNO+JOBNO+COMPANY TAG POPAR5
INDEX ON ROLE+JOBNO+ENQNO+COMPANY TAG POPAR6

The table is populated with about 1500 records related to JOBNO (i.e. ENQNO is empty) first - followed by a similar number related to ENQNO (i.e. JOBNO is empty).

Any ideas?

Could I be 'going too fast'?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Hi Dave

The error is a messagebox like popup box, not even trapped by my error handler (not even fired) that simply reads 'Inconsistency Error'

The records are being populated with a bit of code that just does an 'append blank' and completes the fields:

Code:
SELECT POPJOBS
GO TOP
DO WHILE .NOT. EOF()
	IF !EMPTY(POPJOBS.CLIENT)
		SELECT POPAROLE
		SET ORDER TO POPAR1
		APPEND BLANK
		REPLACE JOBNO WITH POPJOBS.CODE
		REPLACE COMPANY WITH POPJOBS.CLIENT
		REPLACE ROLE WITH "CLIENT"
	ENDIF
	IF !EMPTY(POPJOBS.CONSULT)
		SELECT POPAROLE
		SET ORDER TO POPAR1
		APPEND BLANK
		REPLACE JOBNO WITH POPJOBS.CODE
		REPLACE COMPANY WITH POPJOBS.CONSULT
		REPLACE ROLE WITH "CONSULT"
	ENDIF
	SELECT POPJOBS
	SKIP
ENDDO
SELECT POPJOBS
USE
SELECT POPENQ
GO TOP
DO WHILE .NOT. EOF()
	IF !EMPTY(POPENQ.CLIENT)
		SELECT POPAROLE
		SET ORDER TO POPAR2
		APPEND BLANK
		REPLACE ENQNO WITH POPENQ.CODE
		REPLACE COMPANY WITH POPENQ.CLIENT
		REPLACE ROLE WITH "CLIENT"
	ENDIF
	IF !EMPTY(POPENQ.CONSULT)
		SELECT POPAROLE
		SET ORDER TO POPAR2
		APPEND BLANK
		REPLACE ENQNO WITH POPENQ.CODE
		REPLACE COMPANY WITH POPENQ.CONSULT
		REPLACE ROLE WITH "CONSULT"
	ENDIF
	SELECT POPENQ
	SKIP
ENDDO

The idea is that the system goes through the jobs table (popjobs) and looks for the two fields CLIENT and CONSULT and if they are completed, it adds a record to the POPAROLE table for each one leaving the enquiry number blank and completing the job number.

Then it does the same thing for the enquiries table (popenq) leaving the job number blank and completing the enquiry number.

The bizarre thing is that if I add a blank record BEFORE I start, it completes ok, if I don't - I get the error.

I got the idea of adding a blank (deleted) record from a distant memory of early Clipper programs that couldn't cope with multiple similar keys in index files that hit particular boundaries within the structure (poor boundary checking in the old index code I think).

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
I can't see anything obvious about your routine that would cause issues, other than maybe some network or throughput issues causing indexes to get trashed - which is usually a good indicator of that type of error message.

Have you tried using variables with INSERT INTO instead of APPEND BLANK to see if it made a difference?
It may help in that you will have about half the file I/O.



-Dave Summers-
[cheers]
Even more Fox stuff at:
 
IIRC, Inconsistency Error is one of those that indicates that VFP is confused. That is, it's a first cousin to a C5 error.

How about taking a whole other approach and just using a couple of queries to do this. Here's the one to replace your first APPEND set:

Code:
INSERT INTO PopArole ;
   SELECT PopJobs.Code AS JobNo, ;
          PopJobs.Client AS Company, ;
          "Client" AS Role ;
     FROM PopJobs ;
     WHERE NOT EMPTY(PopJobs.Client)
[code]

If you're in a version earlier than VFP 8, you'll have to do this in two steps. First, run the query into a cursor, then APPEND FROM that cursor.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top