Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Corrupt table observations
Message
From
25/04/2003 15:21:15
 
 
To
25/04/2003 13:41:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00777421
Message ID:
00781633
Views:
15
Second reply to this message... (and I've cut the comments in code down to shrink the width)

Some questions about the code below:

1) Is rel_orders part of the m2mdata.dbc?

2) Does jomast.dbf have any memo fields in it? If so, it might make a difference to add MEMO to the SCATTER.

3) Is gennotes in rel_orders (look like it is) and more importantly is gennotes a MEMO field?

4) Are the following ALL of the fields in gennotes?
- drawingnum
- fcustpono
- gennotes
- fgroup
- finumber

5) Does rel_orders have any field default values or triggers or other stored procedures that might act on it when INSERTed?

6) Is it correct that there are no later TABLEUPDATE()s or that TRANSACTIONS are in use?

All in all I'd characterize this code much like the prior and it I sure don't (yet) see anything that should cause a "corrupted" record count in the table.

cheers

>Another corrupt table popped up today. This time it happened during the automated process. However, it happened to a table that it has never happend to before. This particular table is even ZAPPED before the processing starts, so it should be starting with a clean slate. The table in question was rel_orders.dbf
>
>
CLOSE TABLES
>OPEN DATABASE '\\ECNC\M2M\data\DATA01\m2mdata.dbc' shared
>USE '\\ECNC\M2M\data\DATA01\prod\jomast.dbf' in 1 shared
>USE '\\ECNC\M2M\data\DATA01\sales\somast.dbf' in 2 shared
>USE '\\ECNC\M2M\data\DATA01\sales\soitem.dbf' in 3 shared
>USE '\\ECNC\M2M\data\DATA01\prod\joitem.dbf' in 4 shared
>use '\\ECNC\PUBLIC\data\ecnc\data\rel_orders.dbf' in 5 exclusive
>** had to get the group code from soitem instead of joitem. 
>**If it's entered incorrectly
>** you can reenter on soitem but joitem doesn't get refreshed.
>set exact on
>set deleted on
>set safety off
>zap in 5
>local llFound
>
>
>SELECT 1
>SCAN for fstatus='RELEASED'
>	llfound=(.F.)
>	IF FITYPE != '2'
>		SCATTER MEMVAR
>		m.drawingnum=val(substr(m.fpartno,5))
>		SELECT 2
>		SCAN for fsono==m.fsono and len(fsono)>2
>			m.fcustpono=fcustpono
>			SELECT 3
>			llFound=(.F.)
>			SCAN for fsono==m.fsono and fpartno=m.fpartno
>				m.gennotes=fdesc
>				**remover CR and repl dbl spc with single
>				m.gennotes=ALLTRIM(STRTRAN(m.gennotes,CHR(13),''))
>				m.gennotes=STRTRAN(m.gennotes,'  ',' ')
>				m.fgroup=fgroup
>				m.finumber=finumber
>				INSERT into rel_orders from memvar
>				llFound=(.T.)
>			ENDSCAN
>		endscan	
>		** if there is no sales order. 
>		if llFound=(.F.)
>			select 4
>			go top
>			scan for alltrim(fjobno)==alltrim(m.fjobno)
>				m.gennotes=fdesc
>				m.fgroup=fgroup
>				m.fcustpono=''
>				insert into rel_orders from memvar
>			endscan	
>		endif
>	ENDIF
>ENDSCAN
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform