Back to SPR List Previous Next
Restructured Unload & Reload can delete records without warning.
New Feature Closed - Feature Found:XS.01.12 27 AUG 2009 Fixed:XS.01.13 27 AUG 2009

DETAILS
 If you make changes to the key variables of a record schema then unload and
 reload, some records may not be allowed under the new definition and be
 removed without any warning.

 The deletion is the correct behaviour as the records are not allowed in the
 database according to your new definition. A warning message however would
 be useful.

 The one-step Unload/Purge/Reload procedure in More Procedures... has been
 modified so that it will check and write a warning if there are lost
 records. The code below will also produce a warning.
EXAMPLE PROGRAM
 c
 c Get a before record count
 c
 INTEGER ARRAY OLDCOUNT (30)
 COMPUTE NRECS = NRECS(0)+1
 REDEFINE ARRAY "OLDCOUNT" (NRECS)
 FOR REC= 0,NRECS(0)
 COMPUTE OLDCOUNT(REC+1)=NUMRECS(REC)
 END FOR
 ...
 execute dbms unload...
 execute dbms purge...
 execute dbms reload...
 ...
 c
 c check after record count
 c
 FOR REC= 0,NRECS(0)
 IFTHEN (OLDCOUNT(REC+1) GT NUMRECS(REC))
 SET ITEM FONT IDLAB4,0,0,0,0,"#A0A000"
 SET ITEM IDLAB4,"Reloading Database - Some records were removed"
 WRITE "*** " [OLDCOUNT(REC+1) - NUMRECS(REC)] [TRIM(RECNAME(REC))] "(" REC ") Records have been removed by the restructure."
 ENDIF
 END FOR
WORKAROUND
Be aware that when tightening constraints on key fields that some existing data may not pass the new criteria.
Back to SPR List Previous Next