This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20.6
VERIFY DATA FILE
|
VERIFY DATA FILE ( structurePath ; dataPath ; objects ; options ; method {; tablesArray {; fieldsArray}} ) | ||||||||
Parameter | Type | Description | ||||||
structurePath | Text |
![]() |
Pathname of 4D structure file to be checked | |||||
dataPath | Text |
![]() |
Pathname of 4D data file to be checked | |||||
objects | Longint |
![]() |
Objects to be checked | |||||
options | Longint |
![]() |
Checking options | |||||
method | Text |
![]() |
Name of 4D callback method | |||||
tablesArray | Longint array |
![]() |
Numbers of tables to be checked | |||||
fieldsArray | 2D Integer array, 2D Longint array, 2D Real array |
![]() |
Numbers of indexes to be checked | |||||
Constant | Type | Value | Comment |
Verify all | Longint | 16 | |
Verify indexes | Longint | 8 | This option checks the physical consistency of the indexes, without any link with the data. It signals invalid keys but does not permit you to detect duplicated keys (two indexes that point to the same record). This type of error can only be detected with the Verify All option. |
Verify records | Longint | 4 |
Constant | Type | Value | Comment |
Do not create log file | Longint | 16384 | Generally, this command creates a log file in XML format (refer to the end of the command description). With this option, no log file will be created. |
Timestamp log file name | Longint | 262144 | When this option is passed, the name of the log file generated will contain the date and time of its creation; as a result, it will not replace any log file already generated previously. By default, if this option is not passed, log file names are not timestamped and each new file generated replaces the previous one. |
- $1 | Longint | Message type (see table) |
- $2 | Longint | Object type |
- $3 | Text | Message |
- $4 | Longint | Table number |
- $5 | Longint | Reserved |
The following table describes the contents of the parameters depending on the event type:
Event | $1 (Longint) | $2 (Longint) | $3 (Text) | $4 (Longint) | $5 (Longint) |
Message | 1 | 0 | Progression | Percentage | Reserved |
message | done (0-100) | ||||
Verification finished(*) | 2 | Object type (**) | OK message | Table or index | Reserved |
test | number | ||||
Error | 3 | Object type (**) | Text of error- | Table or index | Reserved |
message | number | ||||
End of execution | 4 | 0 | DONE | 0 | Reserved |
Warning | 5 | Object type(**) | Text of error | Table or index | Reserved |
message | number |
(*) The Verification finished ($1=2) event is never returned when the mode is Verify All. It is only used in Verify Records or Verify Indexes mode.
(**) Object type: When an object is verified, a "finished" message ($1=2), error ($1=3) or warning ($1=5) can be sent. The object type returned in $2 can be one of the following:
Special case: When $4 = 0 for $1=2, 3 or 5, the message does not concern a table or an index but rather the data file as a whole.
The callback method must also return a value in $0 (Longint), which is used to check the execution of the operation:
Note: You cannot interrupt execution via $0 after the End of execution event ($4=1) has been generated.
Two optional arrays can also be used by this command:
By default, the VERIFY DATA FILE command creates a log file in XML format (if you have not passed the Do not create log file option, see the options parameter). This file is placed in the Logs folder of the database and its name is based on the structure file of the current database. For example, for a structure file named “myDB.4db,” the log file will be named “myDB_Verify_Log.xml.”
If you have passed the Timestamp log file name option, the name of the log file includes the date and time of its creation in the form "YYYY-MM-DD HH-MM-SS", which gives us, for example: “myDB_Verify_Log_2015-09-27 15-20-35.xml”. This means that each new log file does not replace the previous one, but it might require subsequent manual action to remove unnecessary files.
Regardless of the option selected, as soon as a log file is generated, its path is returned in the Document system variable after execution of the command.
Simple checking of data and indexes:
VERIFY DATA FILE($StructName;$DataName;Verify indexes+Verify records;Do not create log file;"")
Complete verification with log file:
VERIFY DATA FILE($StructName;$DataName;Verify all;0;"")
Checking of records only:
VERIFY DATA FILE($StructName;$DataName;Verify records;0;"")
Checking of records from tables 3 and 7 only:
ARRAY LONGINT($arrTableNums;2)
$arrTableNums{1}:=3
$arrTableNums{2}:=7
VERIFY DATA FILE($StructName;$DataName;Verify records;0;"FollowScan";$arrTableNums)
Checking of specific indexes (index of field 1 of table 4 and index of fields 2 and 3 of table 5):
ARRAY LONGINT($arrTableNums;0) `not used but mandatory
ARRAY LONGINT($arrIndex;2;0) `2 rows (columns added later)
$arrIndex{1}{0}:=4 ` table number in element 0
APPEND TO ARRAY($arrIndex{1};1) `number of 1st field to be checked
$arrIndex{2}{0}:=5 ` table number in element 0
APPEND TO ARRAY($arrIndex{2};2) ` number of 1st field to be checked
APPEND TO ARRAY($arrIndex{2};3) ` number of 2nd field to be checked
VERIFY DATA FILE($StructName;$DataName;Verify indexes;0;"FollowScan";$arrTableNums;$arrIndex)
Verify the data file, create and display the log file:
VERIFY DATA FILE(Structure file;Data file;Verify all;0;"")
SHOW ON DISK(File(Verification log file).platformPath)
If the callback method does not exist, the verification is not carried out, an error is generated and the system variable OK is set to 0. If a log file was generated, its complete pathname is returned in the Document system variable.
Product: 4D
Theme: 4D Environment
Number:
939
Modified: 4D v11 SQL Release 3
Modified: 4D v15 R3
4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)