Show TOC

Function documentationImporting Data

 

This function allows you to import data from a text file into a table in the database. The text file must be comma or tab delimited.

The window has two sections that allow you to first select the table that will receive the data and to manipulate the order of the columns. The data in the text file may not be in the same order as the columns in the table. This window allows you to cross-reference the columns in the table to the fields in the data file.

The Select Table to Use field: This is a list of all the tables in the database. Select the table you want to import data into. This list box will allow you to make only one selection.

Once you have selected the table you want, this section will changes to show all the columns from the table in the correct order.

The Layout of Columns in Imported File field: If the order of the columns doesn’t match the order of the data in the text file you can move the columns around to match what is in the text file. The column order in the example below matches the order of the columns in the actual table.

To change the order of the columns position the mouse anywhere over the name of a column. Click and hold the left mouse button.

While still pressing the mouse button move the mouse to the left or right. The bar will move indicating where the column will be moved.

When the desired position of the column has been found release the left mouse button and the columns will be adjusted. Notice that in the example the column headings Empfirstname and Emplastname have been switched.

Loading the data

Once you are satisfied the columns are in the right order to match the text file, click Open.

On the Select File for Import box, locate and select the file to be imported and click Open.

All the data in the text file should now be displayed in the upper portion of the import window.

Note that the data has not yet been saved to the database. If, at this point, you click Close, the import will not be completed and no data will save to the database.

Click Save to save the displayed data to the database. This may take several seconds depending on the amount of data to be imported. The hourglass will remain on until all the data has been saved to the database.

All tables in the database have a primary key that is made up of a combination of columns so that each primary key is unique. This is the way the database distinguishes one row of data from another and allows the database engine to quickly locate rows. Because of the primary key restriction duplicate data is not allowed in the primary keys. If you have attempted to import data that is a duplicate of what is already in the table you will get an error. The import process cannot be completed. You will have to find the duplicate data in your text file and remove it. Only then can you complete the import.