Import data
With this function you can load data from text files into your survey database. The text files can be in either 'free' or 'fixed' format. A free format text file will have the fields that are to be loaded separated by a specified delimiter, such as a comma. A fixed format text file has the fields to be loaded in specific columns which have a fixed length.
To run this function: Choose Survey > Survey database > Import data, or...
Database Name
The name of the current database is displayed and cannot be changed.
Format File Name
Enter the name of the format file, or choose it with the file browser. If this file does not currently exist, the CONFIRM CREATION OF NEW FORMAT FILE form will be displayed. If the format file already exists the LOAD TABLES FROM TEXT FILES form will be displayed.
Format File Name
This is the default name for the format file that you are about to create.
Choose Apply to create the format file, and display the SELECT DATABASE TABLES TO INCLUDE IN FORMAT form.
Table Name
Listed under this heading are the names of all tables in the database. This is a display only field.
Include
Enter 'Y' to include the table in the format or 'N' to exclude it from the database format file. If you choose to exclude the table form the format the following fields will disappear from the current row of the form.
Format
You may elect a free format or fixed format only. Your choice here will depend upon the format of the text file that you will be loading. If you choose fixed format the following two fields for delimiter and space fill will disappear from the current row of the form.
Delimiter
The delimiter determines the character that separates fields in the text file that you are about to load. The delimiter must be one of the characters as listed in the attached set browser.
Space Fill
The space fill option only applies to free format files and then is only relevant when unloading database tables. If you choose 'Y' a space will follow each delimiter in the output text file. This is simply to make the text file more readable.
After you select the tables and type of format from the SELECT DATABASE TABLES TO INCLUDE IN FORMAT form choose Apply to display the SELECT FIELDS TO INCLUDE IN FORMAT form. Choose Cancel to return to the SURVEYING menu.
Table Name
This is a display only field in which all the previously selected tables to be included in the format are listed.
Field Name
Under this heading are listed all the field names of the selected tables. They are grouped by table.
Include
Enter 'Y' to include the field in the format or 'N' to exclude it from the database format file. If you choose to exclude the field from the format the following fields will disappear from the current row of the form.
Column
If you previously selected the free format option then this field represents the number of the column in the text file. The column before the first designated delimiter in the text file is column one. The column that follows the delimiter is column two and son on.
If you previously selected the fixed format option then this field represents the start position of the field in the text file. The first position is column one with the column numbers incremented for each character position on the line.
Length
This input is only displayed for the fixed format option. It is the length of the field from the previous start column.
After you select the fields to include in the format from the SELECT FIELDS TO INCLUDE IN FORMAT form choose Apply to display the LOAD DATABASE TABLES FROM TEXT FILES form. Choose Cancel to return to the SURVEYING menu.
Perform overlapping samples check
This filed has no relevance for survey databases and in fact cannot be edited.
Maximum errors allowed during load
You can nominate the number of errors that can be encountered during the load before it will abort. This is advisable as it will show problems in the format file, your text files or the data itself. All encountered errors are logged in an associated database log file and rejected records are written into a reject file for latter inspection.
Table Name
This is a display only field in which the table to be loaded is listed.
Text File Name
This is were you input the name of the text file to load into the database table. You can leave this field blank if you don't have a text file to load. This feature enables you to reuse format files in which there are more tables included than you have text files.
Load Type
Select the type of load from the options Insert, Update, or Ins/Upd.
If you choose an Insert then an insert only load will be performed. This means only records which don't exist in the database table will be loaded with all duplicate and existing records in the text file being rejected.
If you choose Update then an update only load will be performed. With this style of load only records which already exist will be updated with non existing records being reject.
If you choose Ins/Upd then an insert and update load will be performed. In this mode records that already exist in the database will be updated and records which don't will be inserted.
Messages
While the loading process is active messages of progress will be displayed. When loading has completed the SURVEYING menu is displayed.
Database load log file and reject files
During the load operation a log file is maintained to record successful table loads and to record errors encountered. The log file is named as follows dbname.log.
Any records that were rejected are written out to a reject file. This is so you can easily check the aforementioned log file and then correct the problem records. The reject file is given the name of the original text file with a '.rej' extension.
Examples of the database format file, and database log file follow.
Example
An example of a database format file (.dsc) follows.
#
|
Example
An example of a dbname.log is given below.
DATABASE MANAGEMENT - DATABASE LOAD REPORT
|